Terrier IR Platform
2.2.1

uk.ac.gla.terrier.compression
Class OldBitOutputStream

java.lang.Object
  extended by uk.ac.gla.terrier.compression.BitOutputStream
      extended by uk.ac.gla.terrier.compression.OldBitOutputStream
All Implemented Interfaces:
java.io.Closeable, BitOut

Deprecated.

public class OldBitOutputStream
extends BitOutputStream

This class creates sequentially a BitFile file from a stream.

Version:
$Revision: 1.4 $
Author:
Gianni Amati, Vassilis Plachouras, Douglas Johnson
See Also:
BitFile

Constructor Summary
OldBitOutputStream(java.io.File file)
          Deprecated. Constructs an instance of the class for a given file
OldBitOutputStream(java.io.OutputStream is)
          Deprecated. Constructs an instance of the class for a given stream.
OldBitOutputStream(java.lang.String filename)
          Deprecated. Constructs an instance of the class for a given filename
 
Method Summary
 void close()
          Deprecated. Flushes and closes the stream.
 void flush()
          Deprecated. Flush the underlying DataOutputStream to disk
 byte getBitOffset()
          Deprecated. Returns the bit offset in the last byte.
 long getByteOffset()
          Deprecated. Returns the byte offset of the stream.
 int writeBinary(int bitsToWrite, int n)
          Deprecated. Writes a binary integer to the already read buffer.
 int writeGamma(int n)
          Deprecated. Writes an gamma encoded integer to the stream.
 int writeUnary(int n)
          Deprecated. Writes a unary encoded integer to the stream.
 
Methods inherited from class uk.ac.gla.terrier.compression.BitOutputStream
append, append, padAndFlush, writeDelta, writeGolomb, writeInt, writeInterpolativeCode, writeMinimalBinary, writeSkewedGolomb
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OldBitOutputStream

public OldBitOutputStream(java.io.OutputStream is)
                   throws java.io.IOException
Deprecated. 
Constructs an instance of the class for a given stream. The OutputStream is should probably be buffered using java.io.BufferedOutputStream

Parameters:
is - java.io.OutputStream the underlying input stream
Throws:
java.io.IOException - if an I/O error occurs

OldBitOutputStream

public OldBitOutputStream(java.lang.String filename)
                   throws java.io.IOException
Deprecated. 
Constructs an instance of the class for a given filename

Parameters:
filename - java.lang.String the name of the undelying file
Throws:
java.io.IOException - if an I/O error occurs

OldBitOutputStream

public OldBitOutputStream(java.io.File file)
                   throws java.io.IOException
Deprecated. 
Constructs an instance of the class for a given file

Parameters:
file - java.io.File the underlying file
Throws:
java.io.IOException - if an I/O error occurs
Method Detail

writeBinary

public int writeBinary(int bitsToWrite,
                       int n)
                throws java.io.IOException
Deprecated. 
Writes a binary integer to the already read buffer. NB: bitsToWrite > than 32 will give undefined results.

Specified by:
writeBinary in interface BitOut
Overrides:
writeBinary in class BitOutputStream
Parameters:
bitsToWrite - the number of bits to use for encoding
n - the integer
Returns:
should return number of bits but it doesn't
Throws:
java.io.IOException - if an I/O error occurs.

close

public void close()
           throws java.io.IOException
Deprecated. 
Flushes and closes the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class BitOutputStream
Throws:
java.io.IOException - if an I/O error occurs

writeUnary

public int writeUnary(int n)
               throws java.io.IOException
Deprecated. 
Writes a unary encoded integer to the stream.

Specified by:
writeUnary in interface BitOut
Overrides:
writeUnary in class BitOutputStream
Parameters:
n - int the integer to write.
Returns:
should return number of bits but it doesn't
Throws:
java.io.IOException - if an I/O error occurs

writeGamma

public int writeGamma(int n)
               throws java.io.IOException
Deprecated. 
Writes an gamma encoded integer to the stream.

Specified by:
writeGamma in interface BitOut
Overrides:
writeGamma in class BitOutputStream
Parameters:
n - The integer to be encoded and saved in the buffer.
Returns:
should return number of bits but it doesn't
Throws:
java.io.IOException - if an I/O error occurs

getByteOffset

public long getByteOffset()
Deprecated. 
Returns the byte offset of the stream. It corresponds to the position of the byte in which the next bit will be written.

Specified by:
getByteOffset in interface BitOut
Overrides:
getByteOffset in class BitOutputStream
Returns:
the byte offset in the stream.

getBitOffset

public byte getBitOffset()
Deprecated. 
Returns the bit offset in the last byte. It corresponds to the position in which the next bit will be written.

Specified by:
getBitOffset in interface BitOut
Overrides:
getBitOffset in class BitOutputStream
Returns:
the bit offset in the stream.

flush

public void flush()
Deprecated. 
Flush the underlying DataOutputStream to disk

Overrides:
flush in class BitOutputStream

Terrier IR Platform
2.2.1

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