Module: BinData::Array::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



297
298
299
300
301
302
303
304
305
306
307
# File 'lib/bindata/array.rb', line 297

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