MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / _readInt32

Function _readInt32

MathBox/mathbox-bundle.js:48229–48246  ·  view source on GitHub ↗
(buf, offset, littleEndian, noAssert)

Source from the content-addressed store, hash-verified

48227}
48228
48229function _readInt32 (buf, offset, littleEndian, noAssert) {
48230 if (!noAssert) {
48231 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
48232 assert(offset !== undefined && offset !== null, 'missing offset')
48233 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
48234 }
48235
48236 var len = buf.length
48237 if (offset >= len)
48238 return
48239
48240 var val = _readUInt32(buf, offset, littleEndian, true)
48241 var neg = val & 0x80000000
48242 if (neg)
48243 return (0xffffffff - val + 1) * -1
48244 else
48245 return val
48246}
48247
48248Buffer.prototype.readInt32LE = function (offset, noAssert) {
48249 return _readInt32(this, offset, true, noAssert)

Callers 1

mathbox-bundle.jsFile · 0.70

Calls 2

assertFunction · 0.70
_readUInt32Function · 0.70

Tested by

no test coverage detected