public class BitWriter
extends java.lang.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(java.lang.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(java.lang.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(java.lang.String bitString)
java.lang.IllegalArgumentException
- If any characters other than
'0' and '1' appear in the string.public byte[] toByteArray()
public static void main(java.lang.String[] args)
Copyright © 2014 Open Microscopy Environment