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

Method skipOptionalEOL

src/parser/indirect-object-parser.ts:292–303  ·  view source on GitHub ↗

* Skip optional EOL before "endstream".

()

Source from the content-addressed store, hash-verified

290 * Skip optional EOL before "endstream".
291 */
292 private skipOptionalEOL(): void {
293 const byte = this.scanner.peek();
294
295 if (byte === CR) {
296 this.scanner.advance();
297 if (this.scanner.peek() === LF) {
298 this.scanner.advance();
299 }
300 } else if (byte === LF) {
301 this.scanner.advance();
302 }
303 }
304
305 /**
306 * Scan forward from startPos looking for the "endstream" keyword.

Callers 1

readStreamMethod · 0.95

Calls 2

advanceMethod · 0.80
peekMethod · 0.45

Tested by

no test coverage detected