Method: Kafka::Protocol::Decoder#array

Defined in:
lib/kafka/protocol/decoder.rb

#array(&block) ⇒ Array

Decodes an array from the IO object.

The provided block will be called once for each item in the array. It is the responsibility of the block to decode the proper type in the block, since there's no information that allows the type to be inferred automatically.

Returns:

  • (Array)


59
60
61
62
# File 'lib/kafka/protocol/decoder.rb', line 59

def array(&block)
  size = int32
  size.times.map(&block)
end