| Constructor and Description |
|---|
BitOutputStream(OutputStream out)
Use an OutputStream to produce a BitWriter.
|
| Modifier and Type | Method and Description |
|---|---|
long |
nrBits()
Returns the number of bits that have been written to this
bitOutputStream.
|
void |
one()
Write a 1 bit.
|
void |
pad(int factor)
Pad the rest of the block with zeroes and flush. pad(8) flushes the last
unfinished byte.
|
void |
write(int bits,
int width)
Write some bits.
|
void |
zero()
Write a 0 bit.
|
public BitOutputStream(OutputStream out)
out - An Output Streampublic long nrBits()
public void one()
throws IOException
one in interface BitWriterIOExceptionpublic void pad(int factor)
throws IOException
pad in interface BitWriterfactor - The size of the block to pad. This will typically be 8, 16,
32, 64, 128, 256, etc.IOExceptionpublic void write(int bits,
int width)
throws IOException
write in interface BitWriterbits - The bits to be written.width - The number of bits to write. (0..32)IOExceptionpublic void zero()
throws IOException
zero in interface BitWriterIOExceptionCopyright © 2013. All Rights Reserved.