|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.RandomAccessFile
loci.formats.RandomAccessArray
An extension of RandomAccessFile providing random access into an array of bytes directly from memory. The implemention is very straightforward except for the copyArray methods, which replace readFully, and exist solely because readFully is declared final and thus cannot be overridden.
| Constructor Summary | |
RandomAccessArray(String name,
String mode)
|
|
| Method Summary | |
void |
close()
|
void |
copyArray(byte[] b)
This has the same functionality as RandomAccessFile's readFully. |
void |
copyArray(byte[] b,
int off,
int len)
|
long |
getFilePointer()
|
long |
length()
|
int |
read()
Reads a byte of data from the array. |
int |
read(byte[] b)
Reads up to b.length bytes of data from the array. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes from the array. |
void |
seek(long pos)
Sets the file pointer. |
void |
setLength(long newLength)
Sets the array length. |
void |
setStream(byte[] b)
|
int |
skipBytes(int n)
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.io.RandomAccessFile |
getChannel, getFD, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RandomAccessArray(String name,
String mode)
throws FileNotFoundException
| Method Detail |
public void setStream(byte[] b)
public void close()
public long getFilePointer()
public long length()
public void seek(long pos)
public void setLength(long newLength)
public int skipBytes(int n)
public int read()
public int read(byte[] b)
throws IOException
IOException
public int read(byte[] b,
int off,
int len)
throws IOException
IOException
public void copyArray(byte[] b)
throws IOException
IOException
public void copyArray(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic void write(int b)
public void write(byte[] b)
public void write(byte[] b,
int off,
int len)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||