org.terrier.compression
Interface BitInSeekable

All Superinterfaces:
java.io.Closeable
All Known Implementing Classes:
BitFile, BitFileBuffered, BitFileInMemory, BitFileInMemoryLarge

public interface BitInSeekable
extends java.io.Closeable

Interface for reading a bit compressed file in a random access manner. Each method returns a BitIn implementation that allows access to the encoded integers. Several implementations exist:

Since:
2.0
Author:
Craig Macdonald
See Also:
BitFileBuffered, BitOut, BitIn

Method Summary
 BitIn readReset(long startByteOffset, byte startBitOffset)
          Reads from the file a specific number of bytes and after this call, a sequence of read calls may follow.
 BitIn readReset(long startByteOffset, byte startBitOffset, long endByteOffset, byte endBitOffset)
          Reads from the file a specific number of bytes and after this call, a sequence of read calls may follow.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

readReset

BitIn readReset(long startByteOffset,
                byte startBitOffset,
                long endByteOffset,
                byte endBitOffset)
                throws java.io.IOException
Reads from the file a specific number of bytes and after this call, a sequence of read calls may follow. The offsets given as arguments are inclusive. For example, if we call this method with arguments 0, 2, 1, 7, it will read in a buffer the contents of the underlying file from the third bit of the first byte to the last bit of the second byte.

Parameters:
startByteOffset - the starting byte to read from
startBitOffset - the bit offset in the starting byte
endByteOffset - the ending byte
endBitOffset - the bit offset in the ending byte. This bit is the last bit of this entry.
Returns:
Returns the BitIn object to use to read that data
Throws:
java.io.IOException

readReset

BitIn readReset(long startByteOffset,
                byte startBitOffset)
                throws java.io.IOException
Reads from the file a specific number of bytes and after this call, a sequence of read calls may follow. The offsets given as arguments are inclusive. For example, if we call this method with arguments 0, 2, 1, 7, it will read in a buffer the contents of the underlying file from the third bit of the first byte to the last bit of the second byte.

Parameters:
startByteOffset - the starting byte to read from
startBitOffset - the bit offset in the starting byte
Returns:
Returns the BitIn object to use to read that data
Throws:
java.io.IOException


Terrier 3.5. Copyright © 2004-2011 University of Glasgow