Class BinaryOutputStream
java.lang.Object
java.io.OutputStream
BinaryOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class BinaryOutputStream
- extends OutputStream
This output stream provides an eight bit long buffer
for writing individual bits.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
private OutputStream out
buffer
private byte buffer
bCounter
private int bCounter
BinaryOutputStream
public BinaryOutputStream(OutputStream stream)
- Create a binary stream on the top of the given stream.
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
flushBitBuffer
public void flushBitBuffer()
throws IOException
- Flush the bit buffer by padding it with zeros.
- Throws:
IOException
writeBit
public boolean writeBit(boolean bit)
throws IOException
- Throws:
IOException
Copyright © 2007 Aija Niissalo, Marko Laakso, Markus Heinonen.