|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.io.RandomAccessFile
ucar.unidata.io.InMemoryRandomAccessFile
public class InMemoryRandomAccessFile
A RandomAccessFile stored entirely in memory as a byte array.
| Field Summary |
|---|
| Fields inherited from class ucar.unidata.io.RandomAccessFile |
|---|
BIG_ENDIAN, LITTLE_ENDIAN |
| Constructor Summary | |
|---|---|
InMemoryRandomAccessFile(java.lang.String name,
byte[] data)
A RandomAccessFile stored entirely in memory as a byte array. |
|
| Method Summary | |
|---|---|
long |
length()
Get the length of the file. |
long |
readToByteChannel(java.nio.channels.WritableByteChannel dest,
long offset,
long nbytes)
Read nbytes bytes, at the specified file offset, send to a WritableByteChannel. |
void |
setBufferSize(int bufferSize)
Set the buffer size. |
| Methods inherited from class ucar.unidata.io.RandomAccessFile |
|---|
close, flush, getAllFiles, getBufferSize, getDebugLeaks, getDebugNbytes, getDebugNseeks, getFD, getFilePointer, getLocation, getOpenFiles, getRandomAccessFile, isAtEndOfFile, order, read, read, read, readBoolean, readByte, readBytes, readChar, readDouble, readDouble, readFloat, readFloat, readFully, readFully, readInt, readInt, readIntUnbuffered, readLine, readLong, readLong, readShort, readShort, readString, readUnsignedByte, readUnsignedShort, readUTF, searchForward, seek, setDebugAccess, setDebugLeaks, setExtendMode, setMinLength, skipBytes, toString, unread, write, write, write, writeBoolean, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeChar, writeChar, writeChars, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLong, writeLong, writeShort, writeShort, writeUTF |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryRandomAccessFile(java.lang.String name,
byte[] data)
name - used as the locationdata - the complete data file| Method Detail |
|---|
public long length()
RandomAccessFile
length in class RandomAccessFilepublic void setBufferSize(int bufferSize)
RandomAccessFile
setBufferSize in class RandomAccessFilebufferSize - length in bytes
public long readToByteChannel(java.nio.channels.WritableByteChannel dest,
long offset,
long nbytes)
throws java.io.IOException
RandomAccessFilenbytes bytes, at the specified file offset, send to a WritableByteChannel.
This will block until all bytes are read.
This uses the underlying file channel directly, bypassing all user buffers.
readToByteChannel in class RandomAccessFiledest - write to this WritableByteChannel.offset - the offset in the file where copying will start.nbytes - the number of bytes to read.
java.io.IOException - if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||