MCPcopy Create free account
hub / github.com/apache/fory / bufferRef

Method bufferRef

javascript/packages/core/lib/reader/index.ts:284–291  ·  view source on GitHub ↗
(len: number)

Source from the content-addressed store, hash-verified

282 }
283
284 bufferRef(len: number) {
285 if (len < 0 || len > this.byteLength - this.cursor) {
286 throw new Error("Insufficient bytes for buffer reference");
287 }
288 const result = this.platformBuffer.subarray(this.cursor, this.cursor + len);
289 this.cursor += len;
290 return result;
291 }
292
293 bufferRefAt(start: number, len: number) {
294 if (start < 0 || len < 0 || start > this.byteLength - len) {

Callers 4

readBufferRefMethod · 0.45
decodeMethod · 0.45
reader.test.tsFile · 0.45
io.test.tsFile · 0.45

Calls 1

subarrayMethod · 0.45

Tested by

no test coverage detected