public class BitWriter extends Object
Constructor and Description |
---|
BitWriter()
Constructs a new bit writer.
|
BitWriter(int size)
Constructs a new bit writer with the given initial buffer size.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Tests the BitWriter class.
|
byte[] |
toByteArray()
Gets an array containing all bits written thus far.
|
void |
write(int value,
int numBits)
Writes the given value using the given number of bits.
|
void |
write(String bitString)
Writes the bits represented by a bit string to the buffer.
|
public BitWriter()
public BitWriter(int size)
public void write(int value, int numBits)
public void write(String bitString)
IllegalArgumentException
- If any characters other than
'0' and '1' appear in the string.public byte[] toByteArray()
public static void main(String[] args)
Copyright © 2014 Open Microscopy Environment