Terrier IR Platform
2.2.1

uk.ac.gla.terrier.compression
Class MemorySBOS

java.lang.Object
  extended by uk.ac.gla.terrier.compression.BitOutputStream
      extended by uk.ac.gla.terrier.compression.BitByteOutputStream
          extended by uk.ac.gla.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 writting 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()
           
 java.lang.String toString()
          Writes the underlying MemoryOutputStream in String format.
 
Methods inherited from class uk.ac.gla.terrier.compression.BitByteOutputStream
close, getBitOffset, getByteOffset, getByteToWrite, pad, writeInt, writeUnary
 
Methods inherited from class uk.ac.gla.terrier.compression.BitOutputStream
append, append, flush, padAndFlush, writeBinary, writeDelta, writeGamma, writeGolomb, writeInterpolativeCode, writeMinimalBinary, writeSkewedGolomb
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow