MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / checkOffset

Method checkOffset

lib/readers.js:156–162  ·  view source on GitHub ↗

* Checks that the new length to read is within the range of the buffer length. Throws a RangeError if not. * @param {Number} newLength

(newLength)

Source from the content-addressed store, hash-verified

154 * @param {Number} newLength
155 */
156 checkOffset(newLength) {
157 if (this.offset + newLength > this.buf.length) {
158 const err = new RangeError('Trying to access beyond buffer length');
159 err.expectedLength = newLength;
160 throw err;
161 }
162 }
163
164 /**
165 * Reads a protocol string list

Callers 4

readStringMethod · 0.95
readBytesMethod · 0.95
readShortBytesMethod · 0.95
readFlagsInfoMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected