Module: BinData::ReadUntilEOFPlugin

Defined in:
lib/bindata/array.rb

Overview

Logic for the read_until: :eof parameter

Instance Method Summary collapse

Instance Method Details

#do_read(io) ⇒ Object



314
315
316
317
318
319
320
321
322
323
324
# File 'lib/bindata/array.rb', line 314

def do_read(io)
  loop do
    element = append_new_element
    begin
      element.do_read(io)
    rescue EOFError, IOError
      elements.pop
      break
    end
  end
end