Method: IcAgent::Candid.leb128u_decode

Defined in:
lib/ic_agent/candid.rb

.leb128u_decode(pipe) ⇒ Object



1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
# File 'lib/ic_agent/candid.rb', line 1347

def self.leb128u_decode(pipe)
  res = StringIO.new
  loop do
    byte = safe_read_byte(pipe)
    res.putc(byte.hex)
    break if byte < '80' || pipe.length.zero?
  end

  LEB128.decode_signed(res)
end