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

Method readInt16

projects/JavaScript/proto/fbe.js:680–686  ·  view source on GitHub ↗

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

(offset)

Source from the content-addressed store, hash-verified

678 * @returns {!number} Int16 value
679 */
680 readInt16 (offset) {
681 offset = offset >>> 0
682 offset += this._buffer.offset
683 this._buffer.checkOffset(offset, 2)
684 let val = this._buffer.buffer[offset] | (this._buffer.buffer[offset + 1] << 8)
685 return (val & 0x8000) ? val | 0xFFFF0000 : val
686 }
687
688 /**
689 * Read UInt16 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