loci.formats
Interface IRandomAccess

All Superinterfaces:
DataInput, DataOutput
All Known Implementing Classes:
RABytes, RAFile, RAUrl

public interface IRandomAccess
extends DataInput, DataOutput

Interface for random access into structures (e.g., files or arrays).

Source code:
Trac, SVN

Author:
Curtis Rueden ctrueden at wisc.edu

Method Summary
 void close()
          Closes this random access file stream and releases any system resources associated with the stream.
 long getFilePointer()
          Returns the current offset in this file.
 long length()
          Returns the length of this file.
 int read()
          Reads a byte of data from this file.
 int read(byte[] b)
          Reads up to b.length bytes of data from this file into an array of bytes.
 int read(byte[] b, int off, int len)
          Reads up to len bytes of data from this file into an array of bytes.
 void seek(long pos)
          Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.
 void setLength(long newLength)
          Sets the length of this file.
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 
Methods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 

Method Detail

close

void close()
           throws IOException
Closes this random access file stream and releases any system resources associated with the stream.

Throws:
IOException

getFilePointer

long getFilePointer()
                    throws IOException
Returns the current offset in this file.

Throws:
IOException

length

long length()
            throws IOException
Returns the length of this file.

Throws:
IOException

read

int read()
         throws IOException
Reads a byte of data from this file.

Throws:
IOException

read

int read(byte[] b)
         throws IOException
Reads up to b.length bytes of data from this file into an array of bytes.

Throws:
IOException

read

int read(byte[] b,
         int off,
         int len)
         throws IOException
Reads up to len bytes of data from this file into an array of bytes.

Throws:
IOException

seek

void seek(long pos)
          throws IOException
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.

Throws:
IOException

setLength

void setLength(long newLength)
               throws IOException
Sets the length of this file.

Throws:
IOException