Class PDF::Reader::Buffer
In: lib/pdf/reader/buffer.rb
Parent: Object

An internal PDF::Reader class that mediates access to the underlying PDF File or IO Stream

Methods

eof?   find_first_xref_offset   head   new   pos   pos_without_buf   raw   read   read_until   ready_token   seek   token  

Public Class methods

Creates a new buffer around the specified IO object

Public Instance methods

returns true if the underlying IO object is at end and the internal buffer is empty

The Xref table in a PDF file acts as an aid for finding the location of various objects in the file. This method attempts to locate the byte offset of the xref table in the underlying IO stream.

return the internal buffer used by this class when reading from the IO stream.

reads the requested number of bytes from the underlying IO stream.

length should be a positive integer.

Reads from the buffer until the specified token is found, or the end of the buffer

bytes - the bytes to search for.

PDF files are processed by tokenising the content into a series of objects and commands. This prepares the buffer for use by reading the next line of tokens into memory.

Seek to the requested byte in the IO stream.

return the next token from the underlying IO stream

[Validate]