| it.unimi.dsi.mg4j.index.CachingOutputBitStream
CachingOutputBitStream | final public class CachingOutputBitStream extends OutputBitStream (Code) | | A special output bit stream with an additional
method
CachingOutputBitStream.buffer() that returns the internal buffer
if the internal buffer contains all that has been written since
the last call to
OutputBitStream.position(long) position(0) .
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
OutputBitStream.align before retrieving the buffer, or some bits might be still floating in the bit buffer.
|
Method Summary | |
public byte[] | buffer() Return the internal buffer, if it contains all data. |
buffer | public byte[] buffer()(Code) | | Return the internal buffer, if it contains all data.
Note that this method should always be called after an
OutputBitStream.align ,
or some bits might be still floating in the bit buffer.
the internal buffer, if it contains the cached content written since the last call toOutputBitStream.position(long) position(0), or null . |
|
|