MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / getChunk

Method getChunk

modules/crypt/ssl/ssl_stream.js:109–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 return this.#bytes.slice(read, read + n).buffer;
108 }
109 getChunk() {
110 const bytes = this.#bytes;
111 this.#bytes = undefined;
112 if (bytes.i) {
113 delete bytes.i;
114 bytes.buffer.resize(this.#write);
115 return bytes;
116 }
117
118 return bytes.slice(0, this.#write);
119 }
120 get bytesAvailable() {
121 return this.#write - this.#read;
122 }

Callers 9

packetizeFunction · 0.95
packetizeFunction · 0.95
calculateMacFunction · 0.95
aeadAdditionalDataFunction · 0.95
packetizeFunction · 0.95
packetizeFunction · 0.95
unpacketizeFunction · 0.95
p_hashFunction · 0.95
writeMethod · 0.45

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected