module

Amqp::Wire::AmqpZeroNineOne::BitPack

Packs/unpacks consecutive bit fields into octets, LSB-first. Used by exchange.declare, queue.declare, basic.publish, etc.

Instance methods

read(io : IO, count : Int32) : Array(Bool)

Reads count bits packed LSB-first into ceil(count/8) octets.

Source
write(io : IO, bits : Array(Bool)) : Nil

Writes the given bools as a sequence of octets, LSB-first. AMQP packs runs of consecutive bit fields into the smallest number of octets; this helper does the whole run at once.

Source