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

Method readChunk

modules/crypt/ssl/ssl_stream.js:98–108  ·  view source on GitHub ↗
(n, reference)

Source from the content-addressed store, hash-verified

96 return v;
97 }
98 readChunk(n, reference) {
99 const read = this.#read;
100 if (read + n > this.#write)
101 throw new Error;
102
103 this.#read += n;
104 if (reference)
105 return this.#bytes.subarray(read, read + n);
106
107 return this.#bytes.slice(read, read + n).buffer;
108 }
109 getChunk() {
110 const bytes = this.#bytes;
111 this.#bytes = undefined;

Callers 4

SetupCipherFunction · 0.95
unpacketizeFunction · 0.80
unpacketizeFunction · 0.80
parseFunction · 0.80

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected