public class BitOutputStream extends NonBlockingBitOutputStream
NonBlockingBitOutputStream.| Constructor and Description |
|---|
BitOutputStream(OutputStream aOS,
ByteOrder aByteOrder)
Create a new bit output stream based on an existing Java OutputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flush the data and close the underlying output stream.
|
void |
flush()
Write the current cache to the stream and reset the buffer.
|
void |
writeBit(int aBit)
Write a single bit to the stream.
|
getByteOrder, toString, writeBitspublic BitOutputStream(@Nonnull OutputStream aOS, @Nonnull ByteOrder aByteOrder)
aOS - the output stream this class should use. May not be
null.aByteOrder - The non-null byte order to use.public void writeBit(int aBit)
throws IOException
writeBit in class NonBlockingBitOutputStreamaBit - 1 if the bit should be set, 0 if notIOException - In case writing to the output stream failedpublic void flush()
throws IOException
flush in interface Flushableflush in class NonBlockingBitOutputStreamIOException - In case writing to the output stream failedpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class NonBlockingBitOutputStreamCopyright © 2014–2016 Philip Helger. All rights reserved.