public class BitFileInMemory extends Object implements BitInSeekable
Modifier and Type | Field and Description |
---|---|
protected byte[] |
inBuffer
buffer in memory for the entire compressed file
|
protected static org.apache.log4j.Logger |
logger
The logger used
|
Constructor and Description |
---|
BitFileInMemory(byte[] buffer)
Create an object using the specified data as the compressed data
|
BitFileInMemory(InputStream is,
long length)
Loads the entire specified inputstream into memory.
|
BitFileInMemory(String filename)
Loads the entire file represented by filename into memory
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this object.
|
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.
|
protected static final org.apache.log4j.Logger logger
protected final byte[] inBuffer
public BitFileInMemory(String filename) throws IOException
filename
- Location of bit file to read into memoryIOException
- if anything goes wrong reading the filepublic BitFileInMemory(InputStream is, long length) throws IOException
is
- InputStream containing the compressed bitfilelength
- Expected length of the input streamIOException
- if anything goes wrong reading the inputstreampublic BitFileInMemory(byte[] buffer)
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 bytepublic void close()
close
in interface Closeable
close
in interface AutoCloseable
Terrier 4.0. Copyright © 2004-2014 University of Glasgow