Class: TreasureData::FileReader::MessagePackParsingReader

Inherits:
Object
  • Object
show all
Defined in:
lib/td/file_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, error, opts) ⇒ MessagePackParsingReader

Returns a new instance of MessagePackParsingReader.



38
39
40
41
42
43
# File 'lib/td/file_reader.rb', line 38

def initialize(io, error, opts)
  require 'msgpack'
  @io = io
  @error = error
  @u = MessagePack::Unpacker.new(@io)
end

Instance Method Details

#forwardObject

Raises:

  • (EOFError)


45
46
47
48
49
# File 'lib/td/file_reader.rb', line 45

def forward
  content = @u.each {|r| break r }
  raise EOFError unless content
  content
end