|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.compression.BitFileBuffered
public class BitFileBuffered
Implementation of BitInSeekable/BitIn interfaces similar to BitFile. However this class buffers only a small area of the posting list, to minimise large memory allocations during retrieval. In contrast to BitFile, this class is read-only.
Nested Class Summary | |
---|---|
protected static class |
BitFileBuffered.BitInBuffered
Implements a BitIn around a RandomDataInput |
Field Summary | |
---|---|
protected int |
buffer_size
how much of this file we will buffer |
protected static int |
DEFAULT_BUFFER_LENGTH
how much of a file to buffer by default |
protected RandomDataInput |
file
The underlying file |
protected long |
fileSize
how big the file is, so we know when to stop reading |
protected static org.apache.log4j.Logger |
logger
The logger used |
Constructor Summary | |
---|---|
BitFileBuffered(java.io.File _file)
Constructs an instance of the class for a given filename, using the default buffer size |
|
BitFileBuffered(java.io.File _file,
int bufSize)
Constructs an instance of the class for a given filename |
|
BitFileBuffered(RandomDataInput f)
Constructor for a RandomDataInput object |
|
BitFileBuffered(java.lang.String filename)
Constructs an instance of the class for a given filename. |
|
BitFileBuffered(java.lang.String filename,
int bufSize)
Constructs an instance of the class for a given filename |
Method Summary | |
---|---|
void |
close()
|
BitIn |
readReset(long startByteOffset,
byte startBitOffset)
Reads from the file from a specific offset. |
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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_BUFFER_LENGTH
protected static final org.apache.log4j.Logger logger
protected RandomDataInput file
protected final int buffer_size
protected long fileSize
Constructor Detail |
---|
public BitFileBuffered(RandomDataInput f)
public BitFileBuffered(java.io.File _file)
_file
- the underlying filepublic BitFileBuffered(java.lang.String filename)
filename
- java.lang.String the name of the underlying filepublic BitFileBuffered(java.io.File _file, int bufSize)
_file
- the underlying filebufSize
- how much of the file to bufferpublic BitFileBuffered(java.lang.String filename, int bufSize)
filename
- java.lang.String the name of the underlying filebufSize
- how much of the file to bufferMethod Detail |
---|
public BitIn readReset(long startByteOffset, byte startBitOffset, long endByteOffset, byte endBitOffset)
readReset
in interface BitInSeekable
startByteOffset
- the starting byte to read fromstartBitOffset
- the bit offset in the starting byteendByteOffset
- the ending byteendBitOffset
- the bit offset in the ending byte.
This bit is the last bit of this entry.
public BitIn readReset(long startByteOffset, byte startBitOffset)
readReset
in interface BitInSeekable
startByteOffset
- the starting byte to read fromstartBitOffset
- the bit offset in the starting byte
public void close()
close
in interface java.io.Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |