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

Method writeInt16

projects/JavaScript/proto/fbe.js:921–928  ·  view source on GitHub ↗

* Write Int16 value into the field model buffer * @this {!FieldModelBase} * @param {!number} offset Offset * @param {!number} value Int16 value

(offset, value)

Source from the content-addressed store, hash-verified

919 * @param {!number} value Int16 value
920 */
921 writeInt16 (offset, value) {
922 value = +value
923 offset = offset >>> 0
924 offset += this._buffer.offset
925 this._buffer.checkValue(offset, 2, value, -0x8000, 0x7FFF)
926 this._buffer.buffer[offset + 0] = (value & 0xFF)
927 this._buffer.buffer[offset + 1] = (value >>> 8)
928 }
929
930 /**
931 * Write UInt16 value into the field model buffer

Callers 4

setMethod · 0.80
setMethod · 0.80
setMethod · 0.80
setMethod · 0.80

Calls 1

checkValueMethod · 0.45

Tested by

no test coverage detected