Method: PDF::Reader::Buffer#initialize
- Defined in:
- lib/pdf/reader/buffer.rb
#initialize(io, opts = {}) ⇒ Buffer
Creates a new buffer.
Params:
io - an IO stream (usually a StringIO) with the raw data to tokenise
options:
:seek - a byte offset to seek to before starting to tokenise
:content_stream - set to true if buffer will be tokenising a
content stream. Defaults to false
79 80 81 82 83 84 85 86 |
# File 'lib/pdf/reader/buffer.rb', line 79 def initialize(io, opts = {}) @io = io @tokens = [] @in_content_stream = opts[:content_stream] @io.seek(opts[:seek]) if opts[:seek] @pos = @io.pos end |