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

Method writeString

lib/writers.js:108–117  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

106 }
107
108 writeString(str) {
109 if (typeof str === "undefined") {
110 throw new Error("can not write undefined");
111 }
112 const len = Buffer.byteLength(str, 'utf8');
113 const buf = utils.allocBufferUnsafe(2 + len);
114 buf.writeUInt16BE(len, 0);
115 buf.write(str, 2, buf.length-2, 'utf8');
116 this.add(buf);
117 }
118
119 writeLString(str) {
120 const len = Buffer.byteLength(str, 'utf8');

Callers 5

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

Calls 2

addMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected