MCPcopy Index your code
hub / github.com/nodejs/node / readInt16LE

Function readInt16LE

lib/internal/buffer.js:415–424  ·  view source on GitHub ↗
(buf, offset = 0)

Source from the content-addressed store, hash-verified

413}
414
415function readInt16LE(buf, offset = 0) {
416 validateNumber(offset, 'offset');
417 const first = buf[offset];
418 const last = buf[offset + 1];
419 if (first === undefined || last === undefined)
420 boundsError(offset, buf.length - 2);
421
422 const val = first + last * 2 ** 8;
423 return val | (val & 2 ** 15) * 0x1fffe;
424}
425
426function readInt8(buf, offset = 0) {
427 validateNumber(offset, 'offset');

Callers 2

readIntLEFunction · 0.85

Calls 1

boundsErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…