Class: NBTFile::Private::TopTokenizerState

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

Instance Method Details

#get_token(io) ⇒ Object

Raises:

  • (RuntimeError)


239
240
241
242
243
244
245
246
# File 'lib/nbtfile.rb', line 239

def get_token(io)
  type = read_type(io)
  raise RuntimeError, "expected TAG_Compound" unless type == TAG_Compound
  name = read_string(io)
  end_state = EndTokenizerState.new()
  next_state = CompoundTokenizerState.new(end_state)
  [next_state, type[name, nil]]
end