public abstract class NioByteStoreAccess extends java.lang.Object implements ByteStoreAccess
| Constructor and Description |
|---|
NioByteStoreAccess() |
| Modifier and Type | Method and Description |
|---|---|
static java.nio.ByteBuffer[] |
copyBuffers(java.nio.ByteBuffer[] bufs)
Utility method to make a deep copy of an array of ByteBuffers.
|
static ByteStoreAccess |
createAccess(java.nio.ByteBuffer[] bbufs)
Returns a reader implementation for an array of ByteBuffers.
|
protected abstract java.nio.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 java.nio.ByteBuffer getBuffer(int nbyte)
throws java.io.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 readjava.io.IOExceptionpublic byte readByte()
throws java.io.IOException
ByteStoreAccessreadByte in interface ByteStoreAccessjava.io.IOExceptionpublic short readShort()
throws java.io.IOException
ByteStoreAccessreadShort in interface ByteStoreAccessjava.io.IOExceptionpublic char readChar()
throws java.io.IOException
ByteStoreAccessreadChar in interface ByteStoreAccessjava.io.IOExceptionpublic int readInt()
throws java.io.IOException
ByteStoreAccessreadInt in interface ByteStoreAccessjava.io.IOExceptionpublic long readLong()
throws java.io.IOException
ByteStoreAccessreadLong in interface ByteStoreAccessjava.io.IOExceptionpublic float readFloat()
throws java.io.IOException
ByteStoreAccessreadFloat in interface ByteStoreAccessjava.io.IOExceptionpublic double readDouble()
throws java.io.IOException
ByteStoreAccessreadDouble in interface ByteStoreAccessjava.io.IOExceptionpublic void readBytes(byte[] b,
int offset,
int length)
throws java.io.IOException
ByteStoreAccessreadBytes in interface ByteStoreAccessb - buffer to receive bytesoffset - offset into b for first bytelength - number of bytes to readjava.io.IOExceptionpublic static java.nio.ByteBuffer[] copyBuffers(java.nio.ByteBuffer[] bufs)
bufs - input bufferspublic static ByteStoreAccess createAccess(java.nio.ByteBuffer[] bbufs)
bbufs - buffer array