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, waitseek, skipprotected 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 readIOExceptionpublic byte readByte()
throws IOException
ByteStoreAccessreadByte in interface ByteStoreAccessIOExceptionpublic short readShort()
throws IOException
ByteStoreAccessreadShort in interface ByteStoreAccessIOExceptionpublic char readChar()
throws IOException
ByteStoreAccessreadChar in interface ByteStoreAccessIOExceptionpublic int readInt()
throws IOException
ByteStoreAccessreadInt in interface ByteStoreAccessIOExceptionpublic long readLong()
throws IOException
ByteStoreAccessreadLong in interface ByteStoreAccessIOExceptionpublic float readFloat()
throws IOException
ByteStoreAccessreadFloat in interface ByteStoreAccessIOExceptionpublic double readDouble()
throws IOException
ByteStoreAccessreadDouble in interface ByteStoreAccessIOExceptionpublic void readBytes(byte[] b,
int offset,
int length)
throws IOException
ByteStoreAccessreadBytes in interface ByteStoreAccessb - buffer to receive bytesoffset - offset into b for first bytelength - number of bytes to readIOExceptionpublic 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.