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

Method writeBytes

lib/writers.js:68–82  ·  view source on GitHub ↗

* Writes bytes according to Cassandra * @param {Buffer|null|types.unset} bytes

(bytes)

Source from the content-addressed store, hash-verified

66 * @param {Buffer|null|types.unset} bytes
67 */
68 writeBytes(bytes) {
69 if (bytes === null) {
70 //Only the length buffer containing -1
71 this.writeInt(-1);
72 return;
73 }
74 if (bytes === types.unset) {
75 this.writeInt(-2);
76 return;
77 }
78 //Add the length buffer
79 this.writeInt(bytes.length);
80 //Add the actual buffer
81 this.add(bytes);
82 }
83
84 /**
85 * Writes a buffer according to Cassandra protocol: bytes.length (2) + bytes

Callers 4

writeMethod · 0.95
writeMethod · 0.95
writeCustomPayloadMethod · 0.95
writeQueryParametersMethod · 0.80

Calls 2

writeIntMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected