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

Method skipStreamEOL

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

* Skip the EOL after "stream" keyword. * Per PDF spec: single EOL (LF or CRLF) after "stream"

()

Source from the content-addressed store, hash-verified

272 * Per PDF spec: single EOL (LF or CRLF) after "stream"
273 */
274 private skipStreamEOL(): void {
275 const byte = this.scanner.peek();
276
277 if (byte === CR) {
278 this.scanner.advance();
279 // CRLF
280 if (this.scanner.peek() === LF) {
281 this.scanner.advance();
282 }
283 } else if (byte === LF) {
284 this.scanner.advance();
285 }
286 // If no EOL, be lenient and continue anyway
287 }
288
289 /**
290 * Skip optional EOL before "endstream".

Callers 1

readStreamMethod · 0.95

Calls 2

advanceMethod · 0.80
peekMethod · 0.45

Tested by

no test coverage detected