Method: Kafka::Protocol::Encoder#write_array

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

#write_array(array, &block) ⇒ nil

Writes an array to the IO object.

Each item in the specified array will be yielded to the provided block; it's the responsibility of the block to write those items using the encoder.

Parameters:

  • array (Array)

Returns:

  • (nil)


68
69
70
71
# File 'lib/kafka/protocol/encoder.rb', line 68

def write_array(array, &block)
  write_int32(array.size)
  array.each(&block)
end