Class: Furnace::SWF::Ubit

Inherits:
BinData::BasePrimitive
  • Object
show all
Defined in:
lib/furnace-swf/swf/ubit.rb

Instance Method Summary collapse

Instance Method Details

#do_num_bytesObject



9
10
11
# File 'lib/furnace-swf/swf/ubit.rb', line 9

def do_num_bytes
  eval_parameter(:length) / 8.0
end

#do_write(io) ⇒ Object



5
6
7
# File 'lib/furnace-swf/swf/ubit.rb', line 5

def do_write(io)
  io.writebits(_value, eval_parameter(:length), :little)
end

#read_and_return_value(io) ⇒ Object



13
14
15
# File 'lib/furnace-swf/swf/ubit.rb', line 13

def read_and_return_value(io)
  io.readbits(eval_parameter(:length), :big)
end

#sensible_defaultObject



17
18
19
# File 'lib/furnace-swf/swf/ubit.rb', line 17

def sensible_default
  0
end