class UIntBase128
Public Instance Methods
read_and_return_value(io)
click to toggle source
# File lib/woff/file.rb, line 8 def read_and_return_value(io) value = 0 offset = 0 loop do byte = io.readbytes(1).unpack('C')[0] value |= (byte & 0x7F) << offset offset += 7 if byte & 0x80 == 0 break end end value end
sensible_default()
click to toggle source
# File lib/woff/file.rb, line 24 def sensible_default 0 end
value_to_binary_string(value)
click to toggle source
TODO: This should, like actually encode the value. This file might help: github.com/khaledhosny/woff2/blob/f43ad222715f58ea62a004b54e4b6a31e589e762/src/variable_length.cc
# File lib/woff/file.rb, line 4 def value_to_binary_string(value) "0" end