public final class ReadBufferManager extends Object
| Constructor and Description |
|---|
ReadBufferManager(FileChannel channel)
Instantiates a ReadBufferManager to read the specified channel
|
ReadBufferManager(FileChannel channel,
int bufferSize)
Instantiates a ReadBufferManager to read the specified channel.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
get()
Gets the byte value at the current position
|
ByteBuffer |
get(byte[] buffer)
Gets the byte[] value at the current position
|
ByteBuffer |
get(long pos,
byte[] buffer)
Gets the byte[] value at the specified position
|
byte |
getByte(long bytePos)
Gets the byte value at the specified position
|
double |
getDouble()
Gets the double value at the specified position
|
double |
getDouble(long bytePos)
Gets the double value at the specified position
|
int |
getInt()
Gets the int value at the current position
|
int |
getInt(long bytePos)
Gets the int value at the specified position
|
long |
getLength()
Gets the size of the channel
|
long |
getLong()
Gets the long value at the current position
|
long |
getLong(long bytePos)
Gets the long value at the specified position
|
long |
getPosition()
Gets the positionf of this buffer in the file it's reading.
|
boolean |
isEOF()
If the current position is at the end of the channel
|
void |
order(ByteOrder order)
Specifies the byte order.
|
void |
position(long position)
Moves the current position to the specified one
|
long |
remaining()
Gets the number of remaining bytes in the current file, starting from the
current position
|
void |
skip(int numBytes)
skips the specified number of bytes from the current position in the
channel
|
public ReadBufferManager(FileChannel channel) throws IOException
channel - IOExceptionpublic ReadBufferManager(FileChannel channel, int bufferSize) throws IOException
channel - bufferSize - IOExceptionpublic byte getByte(long bytePos)
throws IOException
bytePos - IOExceptionpublic long getLength()
throws IOException
IOExceptionpublic void order(ByteOrder order)
ByteBufferorder - public int getInt(long bytePos)
throws IOException
bytePos - IOExceptionpublic long getLong(long bytePos)
throws IOException
bytePos - IOExceptionpublic long getLong()
throws IOException
IOExceptionpublic byte get()
throws IOException
IOExceptionpublic int getInt()
throws IOException
IOExceptionpublic void skip(int numBytes)
throws IOException
numBytes - IOExceptionpublic ByteBuffer get(byte[] buffer) throws IOException
buffer - IOExceptionpublic ByteBuffer get(long pos, byte[] buffer) throws IOException
pos - buffer - IOExceptionpublic void position(long position)
position - public long getPosition()
public double getDouble()
throws IOException
IOExceptionpublic double getDouble(long bytePos)
throws IOException
bytePos - IOExceptionpublic boolean isEOF()
throws IOException
IOExceptionpublic long remaining()
throws IOException
IOExceptionCopyright © 2019 CNRS. All rights reserved.