public final class CachingOutputBitStream extends OutputBitStream
buffer()that returns the internal buffer if the internal buffer contains all that has been written since the last call to
This bit stream is used every time that it is necessary to cache quickly a bit stream.
By sizing the buffer size appropriately, most of the times data written to the stream
will be readable directly from the buffer. Remember to call
before retrieving the buffer, or some bits might be still floating in the bit buffer.
|Constructor and Description|
|Modifier and Type||Method and Description|
Return the internal buffer, if it contains all data.
align, close, copyFrom, flush, position, write, write, write, writeBit, writeBit, writeByteOffset, writeDelta, writeDeltas, writeGamma, writeGammas, writeGolomb, writeGolomb, writeInt, writeLong, writeLongDelta, writeLongGamma, writeLongGolomb, writeLongGolomb, writeLongMinimalBinary, writeLongMinimalBinary, writeLongNibble, writeLongShiftedGamma, writeLongSkewedGolomb, writeLongUnary, writeLongZeta, writeMinimalBinary, writeMinimalBinary, writeNibble, writeShiftedGamma, writeShiftedGammas, writeSkewedGolomb, writeUnary, writeZeta, writtenBits, writtenBits
public CachingOutputBitStream(File file, int bufferSize) throws FileNotFoundException
public byte buffer()
Note that this method should always be called after an
or some bits might be still floating in the bit buffer.