public class SimpleMappedInput extends Object implements BasicInput
Note: DO NOT use an instance
of this class from multiple threads - see Unmapper
.
Constructor and Description |
---|
SimpleMappedInput(BufferManager bufManager)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This does not close the BufManager.
|
long |
getOffset()
Returns the curent position in this stream
(optional operation).
|
boolean |
isRandom()
Indicates whether this object supports random access.
|
byte |
readByte()
Reads a byte from the stream.
|
void |
readBytes(byte[] bbuf)
Reads bytes into an array from the stream.
|
double |
readDouble()
Reads an 8-byte floating point value from the stream.
|
float |
readFloat()
Reads a 4-byte floating point value from the stream.
|
int |
readInt()
Reads a 4-byte integer from the stream.
|
long |
readLong()
Reads an 8-byte integer from the stream.
|
short |
readShort()
Reads a 2-byte integer from the stream.
|
void |
seek(long pos)
Moves the current position of this stream to a given byte offset
(optional operation).
|
void |
skip(long nbyte)
Skips a given number of bytes forwards through the stream.
|
public SimpleMappedInput(BufferManager bufManager) throws IOException
bufManager
- buffer manager for the file regionIOException
public boolean isRandom()
BasicInput
isRandom
in interface BasicInput
public void seek(long pos) throws EOFException
BasicInput
seek
in interface BasicInput
EOFException
public long getOffset()
BasicInput
getOffset
in interface BasicInput
public void skip(long nbyte) throws IOException
BasicInput
skip
in interface BasicInput
nbyte
- number of bytes to skipIOException
public byte readByte() throws EOFException
BasicInput
readByte
in interface BasicInput
EOFException
public short readShort() throws EOFException
BasicInput
readShort
in interface BasicInput
EOFException
public int readInt() throws EOFException
BasicInput
readInt
in interface BasicInput
EOFException
public long readLong() throws EOFException
BasicInput
readLong
in interface BasicInput
EOFException
public float readFloat() throws EOFException
BasicInput
readFloat
in interface BasicInput
EOFException
public double readDouble() throws EOFException
BasicInput
readDouble
in interface BasicInput
EOFException
public void readBytes(byte[] bbuf) throws EOFException
BasicInput
readBytes
in interface BasicInput
bbuf
- array into which the bytes are read;
the number of bytes read is the length of the arrayEOFException
public void close()
close
in interface BasicInput
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.