Modeled after CollStream. Produces a bit stream out if an array of integers. The least significant bit comes first in each byte (LSB). Use class RedBitStream2 for most significant bit first (MSB).
collection |
An Array of integers. |
byte |
Number of bits per byte in this collection of integers. If byte is 8 then integers should not be greater than 255. |
Get or set the byte position.
Get the current collection.
Get the current bit stream.
Step one bit forward and return the bit value at that position. Returns nil
when reached the end.
Step forward byte number of bits. Returns an Array of bit values and can contain nil
when reached the end.
Get the bit value (0/1) at the current position.
Get the byte at the current -bytePos position (reading from -collection).
Set the bit value (0/1) at the current position.
bit |
Value 0 or 1. |
Get or set the bit position.
Write a value at current position and advance the position by one bit.
item |
Value 0 or 1. |
Write a byte value at the current position and advance the position by one byte.
item |
A byte value. |
Empty the -collection and set -pos to 0.