org.terrier.compression
Class MemorySBOS
java.lang.Object
org.terrier.compression.BitOutputStream
org.terrier.compression.BitByteOutputStream
org.terrier.compression.MemorySBOS
- All Implemented Interfaces:
- java.io.Closeable, BitOut
public class MemorySBOS
- extends BitByteOutputStream
This class extends the BitByteOutputStream, so it provides the compression writing functions, but
uses a MemoryOutputStream as an underlying OutputStream, so it is needed to be flushed to disk separately.
It uses BitByteOutputStream and not BitOutputStream because the MemoryOutputStream class has already its own buffer
(to keep everything in memory), and extra buffering is inadequate.
- Author:
- Roi Blanco
Constructor Summary |
MemorySBOS()
Constructor for the class. |
Method Summary |
MemoryOutputStream |
getMOS()
|
int |
getSize()
Return the amount of memory bytes consumed by the underlying buffer |
java.lang.String |
toString()
Writes the underlying MemoryOutputStream in String format. |
Methods inherited from class org.terrier.compression.BitOutputStream |
append, append, flush, padAndFlush, writeBinary, writeDelta, writeGamma, writeGolomb, writeInterpolativeCode, writeMinimalBinary, writeSkewedGolomb |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
mos
protected MemoryOutputStream mos
- The underlying MemoryOutputStream
MemorySBOS
public MemorySBOS()
throws java.io.IOException
- Constructor for the class. Instanciates the BitByteOutputStream and MemoryOutputStream classes.
- Throws:
java.io.IOException
- if an I/O error occurs.
toString
public java.lang.String toString()
- Writes the underlying MemoryOutputStream in String format.
- Overrides:
toString
in class java.lang.Object
getMOS
public MemoryOutputStream getMOS()
- Returns:
- The underlying MemoryOutputStream.
getSize
public int getSize()
- Return the amount of memory bytes consumed by the underlying buffer
Terrier 3.5. Copyright © 2004-2011 University of Glasgow