Method: Cborb::Decoding::State#consume_byte

Defined in:
lib/cborb/decoding/state.rb

#consume_byteInteger

Consume 1 byte(uses #getbyte instead of #read)

Returns:

  • (Integer)


62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/cborb/decoding/state.rb', line 62

def consume_byte
  ib = @buffer.getbyte

  if ib.nil?
    @buffer.reset!

    while ib.nil?
      Fiber.yield
      ib = @buffer.getbyte
    end
  end

  ib
end