MCPcopy Create free account
hub / github.com/LibPDF-js/core / slice

Method slice

src/io/binary-scanner.ts:224–232  ·  view source on GitHub ↗

Create a sub-scanner for a portion of the data

(offset: number, length: number)

Source from the content-addressed store, hash-verified

222
223 /** Create a sub-scanner for a portion of the data */
224 slice(offset: number, length: number): BinaryScanner {
225 if (offset < 0 || offset + length > this.length) {
226 throw new RangeError(
227 `Slice [${offset}, ${offset + length}) out of bounds [0, ${this.length}]`,
228 );
229 }
230
231 return new BinaryScanner(this.bytes.subarray(offset, offset + length));
232 }
233
234 /** Peek at uint16 big-endian without advancing */
235 peekUint16(offset = 0): number {

Callers 15

GETFunction · 0.80
toHexStringFunction · 0.80
toAsciiStringFunction · 0.80
hexToBytesFunction · 0.80
isPdfHeaderFunction · 0.80
getPdfVersionFunction · 0.80
signing.test.tsFile · 0.80
desBlockFunction · 0.80
crypto-key.test.tsFile · 0.80
createMethod · 0.80

Calls

no outgoing calls

Tested by 2

assertNoDanglingRefsFunction · 0.64
createPageTextFunction · 0.64