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

Function readInt16BE

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

Source from the content-addressed store, hash-verified

505}
506
507function readInt16BE(buf, offset = 0) {
508 validateNumber(offset, 'offset');
509 const first = buf[offset];
510 const last = buf[offset + 1];
511 if (first === undefined || last === undefined)
512 boundsError(offset, buf.length - 2);
513
514 const val = first * 2 ** 8 + last;
515 return val | (val & 2 ** 15) * 0x1fffe;
516}
517
518// Read floats
519function readFloatBackwards(offset = 0) {

Callers 2

readIntBEFunction · 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…