MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / readInt8

Method readInt8

projects/JavaScript/proto/fbe.js:651–659  ·  view source on GitHub ↗

* Read Int8 value from the field model buffer * @this {!FieldModelBase} * @param {!number} offset Offset * @returns {!number} Int8 value

(offset)

Source from the content-addressed store, hash-verified

649 * @returns {!number} Int8 value
650 */
651 readInt8 (offset) {
652 offset = offset >>> 0
653 offset += this._buffer.offset
654 this._buffer.checkOffset(offset, 1)
655 if ((this._buffer.buffer[offset] & 0x80) === 0) {
656 return (this._buffer.buffer[offset])
657 }
658 return ((0xFF - this._buffer.buffer[offset] + 1) * -1)
659 }
660
661 /**
662 * Read UInt8 value from the field model buffer

Callers 4

getMethod · 0.45
getMethod · 0.45
getMethod · 0.45
getMethod · 0.45

Calls 1

checkOffsetMethod · 0.45

Tested by

no test coverage detected