Class: NBTFile::CompoundReaderState

Inherits:
Object
  • Object
show all
Includes:
ReadMethods, Tokens
Defined in:
lib/nbtfile.rb

Instance Method Summary collapse

Methods included from ReadMethods

#read_byte, #read_byte_array, #read_double, #read_float, #read_int, #read_integer, #read_list_header, #read_long, #read_raw, #read_short, #read_string, #read_type, #read_value

Methods included from CommonMethods

#sign_bit

Constructor Details

#initialize(cont) ⇒ CompoundReaderState

Returns a new instance of CompoundReaderState.



223
224
225
# File 'lib/nbtfile.rb', line 223

def initialize(cont)
  @cont = cont
end

Instance Method Details

#get_token(io) ⇒ Object



227
228
229
230
231
232
233
234
235
236
237
# File 'lib/nbtfile.rb', line 227

def get_token(io)
  type = read_type(io)

  if type != TAG_End
    name = read_string(io)
  else
    name = ""
  end

  read_value(io, type, name, self, @cont)
end