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

Method unshift

lib/readers.js:91–96  ·  view source on GitHub ↗

* Modifies the underlying buffer, it concatenates the given buffer with the original (internalBuffer = concat(bytes, internalBuffer)

(bytes)

Source from the content-addressed store, hash-verified

89 * Modifies the underlying buffer, it concatenates the given buffer with the original (internalBuffer = concat(bytes, internalBuffer)
90 */
91 unshift(bytes) {
92 if (this.offset > 0) {
93 throw new Error('Can not modify the underlying buffer if already read');
94 }
95 this.buf = Buffer.concat([bytes, this.buf], bytes.length + this.buf.length);
96 }
97
98 /**
99 * Reads any number of bytes and moves the offset.

Callers 4

defineInstanceMembersFunction · 0.80
writeMethod · 0.80
integer.jsFile · 0.80
constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected