Method: ErlangBitstream#value
- Defined in:
- lib/utils/erlang_parser.rb
#value(encoding = 'utf-8') ⇒ Object
144 145 146 147 148 149 150 151 |
# File 'lib/utils/erlang_parser.rb', line 144 def value(encoding = 'utf-8') # fill in the rest rest = '0' * (8 - @cur_bits.length) + @cur_bits arr = @data + [rest.to_i(2)] s = arr.pack('C*') s.force_encoding(encoding) unless encoding.nil? s end |