public class BitFileBuffered extends Object implements BitInSeekable
Modifier and Type | Class and Description |
---|---|
protected static class |
BitFileBuffered.BitInBuffered
Implements a BitIn around a RandomDataInput
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
BitFileBuffered(File _file)
Constructs an instance of the class for a given filename, using the default buffer size
|
BitFileBuffered(File _file,
int bufSize)
Constructs an instance of the class for a given filename
|
BitFileBuffered(RandomDataInput f)
Constructor for a RandomDataInput object
|
BitFileBuffered(String filename)
Constructs an instance of the class for a given filename.
|
BitFileBuffered(String filename,
int bufSize)
Constructs an instance of the class for a given filename
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
public BitFileBuffered(RandomDataInput f)
public BitFileBuffered(File _file)
_file
- the underlying filepublic BitFileBuffered(String filename)
filename
- java.lang.String the name of the underlying filepublic BitFileBuffered(File _file, int bufSize)
_file
- the underlying filebufSize
- how much of the file to bufferpublic BitFileBuffered(String filename, int bufSize)
filename
- java.lang.String the name of the underlying filebufSize
- how much of the file to bufferpublic 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