|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.compression.BitInputStream uk.ac.gla.terrier.compression.OldBitInputStream
public class OldBitInputStream
This class provides sequential stream access to a compressed BitFile file.
BitFile
Constructor Summary | |
---|---|
OldBitInputStream(java.io.File file)
Constructs an instance of the class for a given file |
|
OldBitInputStream(java.io.InputStream is)
Constructs an instance of the class for a given stream. |
|
OldBitInputStream(java.lang.String filename)
Constructs an instance of the class for a given filename |
Method Summary | |
---|---|
void |
align()
Aligns the stream to the next byte |
void |
close()
Closes the stream. |
byte |
getBitOffset()
Returns the bit offset in the last byte. |
long |
getByteOffset()
Returns the byte offset of the stream. |
int |
readBinary(int noBits)
Reads a binary integer from the already read buffer. |
int |
readGamma()
Reads a gamma encoded integer from the stream |
int |
readUnary()
Reads a unary encoded integer from the stream. |
void |
skipBits(int noBits)
Skip a number of bits in the current input stream |
Methods inherited from class uk.ac.gla.terrier.compression.BitInputStream |
---|
readDelta, readGolomb, readInterpolativeCoding, readMinimalBinary, readMinimalBinaryZero, readSkewedGolomb |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OldBitInputStream(java.io.InputStream is) throws java.io.IOException
is
- java.io.InputStream the underlying input stream
java.io.IOException
- if an I/O error occurspublic OldBitInputStream(java.lang.String filename) throws java.io.IOException
filename
- java.lang.String the name of the undelying file
java.io.IOException
- if an I/O error occurspublic OldBitInputStream(java.io.File file) throws java.io.IOException
file
- java.io.File the underlying file
java.io.IOException
- if an I/O error occursMethod Detail |
---|
public int readBinary(int noBits) throws java.io.IOException
readBinary
in interface BitIn
readBinary
in class BitInputStream
noBits
- the number of binary bits to read
java.io.IOException
- if an I/O error occurspublic void skipBits(int noBits) throws java.io.IOException
skipBits
in interface BitIn
skipBits
in class BitInputStream
noBits
- The number of bits to skip
java.io.IOException
- if an I/O error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class BitInputStream
java.io.IOException
- if an I/O error occurspublic int readUnary() throws java.io.IOException
readUnary
in interface BitIn
readUnary
in class BitInputStream
java.io.IOException
- if an I/O error occurspublic int readGamma() throws java.io.IOException
readGamma
in interface BitIn
readGamma
in class BitInputStream
java.io.IOException
- if an I/O error occurspublic long getByteOffset()
getByteOffset
in interface BitIn
getByteOffset
in class BitInputStream
public byte getBitOffset()
getBitOffset
in interface BitIn
getBitOffset
in class BitInputStream
public void align() throws java.io.IOException
align
in interface BitIn
align
in class BitInputStream
java.io.IOException
- if an I/O error occurs
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |