public abstract class NioByteStoreAccess extends Object implements ByteStoreAccess
Constructor and Description |
---|
NioByteStoreAccess() |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer[] |
copyBuffers(ByteBuffer[] bufs)
Utility method to make a deep copy of an array of ByteBuffers.
|
static ByteStoreAccess |
createAccess(ByteBuffer[] bbufs)
Returns a reader implementation for an array of ByteBuffers.
|
protected abstract ByteBuffer |
getBuffer(int nbyte)
Returns a buffer with at least the requested number of bytes
between the current position and the limit.
|
byte |
readByte()
Reads a byte from the current position.
|
void |
readBytes(byte[] b,
int offset,
int length)
Reads bytes into a buffer from the current position.
|
char |
readChar()
Reads a char from the current position.
|
double |
readDouble()
Reads a double from the current position.
|
float |
readFloat()
Reads a float from the current position.
|
int |
readInt()
Reads an int from the current position.
|
long |
readLong()
Reads a long from the current position.
|
short |
readShort()
Reads a short from the current position.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
seek, skip
protected abstract ByteBuffer getBuffer(int nbyte) throws IOException
nbyte
bytes have been read from the returned
buffer, the current position of this ByteStoreAccess will have
advanced by nbyte
bytes. The position in the case
that this call is made with no corresponding read is undefined,
so it's important that the read is actually done (don't call
this method speculatively).
If no such buffer is available (the end of the storage has been reached), then an IOException will be thrown.
nbyte
- number of bytes requirednbyte
bytes can be readIOException
public byte readByte() throws IOException
ByteStoreAccess
readByte
in interface ByteStoreAccess
IOException
public short readShort() throws IOException
ByteStoreAccess
readShort
in interface ByteStoreAccess
IOException
public char readChar() throws IOException
ByteStoreAccess
readChar
in interface ByteStoreAccess
IOException
public int readInt() throws IOException
ByteStoreAccess
readInt
in interface ByteStoreAccess
IOException
public long readLong() throws IOException
ByteStoreAccess
readLong
in interface ByteStoreAccess
IOException
public float readFloat() throws IOException
ByteStoreAccess
readFloat
in interface ByteStoreAccess
IOException
public double readDouble() throws IOException
ByteStoreAccess
readDouble
in interface ByteStoreAccess
IOException
public void readBytes(byte[] b, int offset, int length) throws IOException
ByteStoreAccess
readBytes
in interface ByteStoreAccess
b
- buffer to receive bytesoffset
- offset into b
for first bytelength
- number of bytes to readIOException
public static ByteBuffer[] copyBuffers(ByteBuffer[] bufs)
bufs
- input bufferspublic static ByteStoreAccess createAccess(ByteBuffer[] bbufs)
bbufs
- buffer arrayCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.