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

Method writeShortBytes

lib/writers.js:88–98  ·  view source on GitHub ↗

* Writes a buffer according to Cassandra protocol: bytes.length (2) + bytes * @param {Buffer} bytes

(bytes)

Source from the content-addressed store, hash-verified

86 * @param {Buffer} bytes
87 */
88 writeShortBytes(bytes) {
89 if(bytes === null) {
90 //Only the length buffer containing -1
91 this.writeShort(-1);
92 return;
93 }
94 //Add the length buffer
95 this.writeShort(bytes.length);
96 //Add the actual buffer
97 this.add(bytes);
98 }
99
100 /**
101 * Writes a single byte

Callers 2

writeMethod · 0.95
writeMethod · 0.95

Calls 2

writeShortMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected