class BitStream::Cstring
Public Class Methods
instance(props)
click to toggle source
# File lib/types/cstring.rb, line 13 def self.instance(props) @instance end
Public Instance Methods
length()
click to toggle source
# File lib/types/cstring.rb, line 17 def length nil end
read(s, offset)
click to toggle source
# File lib/types/cstring.rb, line 21 def read(s, offset) byteindex = offset / 8 bitindex = offset % 8 val = "" begin byte = s[byteindex].unpack('C')[0] val << byte byteindex += 1 end while byte != 0 bytelen = val.size val.slice!(val.size - 1) return FieldInfo.new(val, 8 * bytelen) end
write(s, offset, data)
click to toggle source
# File lib/types/cstring.rb, line 36 def write(s, offset, data) end