edu.illinois.cs.cogcomp.lbj.coref.util.io
Interface RandomAccessData

All Known Subinterfaces:
RandomAccessInput
All Known Implementing Classes:
RandomAccessByteBuffer

public interface RandomAccessData

Interface for the random access related methods of RandomAccessFile. Names relating to files are preserved to allow drop-in use.


Method Summary
 long getFilePointer()
          Returns the current offset in the data, in bytes.
 long length()
          Gets the number of bytes of data.
 void seek(long pos)
          Sets the offset in the data, in bytes.
 

Method Detail

getFilePointer

long getFilePointer()
                    throws java.io.IOException
Returns the current offset in the data, in bytes.

Returns:
The offset in bytes relative to the beginning of the data.
Throws:
java.io.IOException - if an I/O error is encountered.

seek

void seek(long pos)
          throws java.io.IOException
Sets the offset in the data, in bytes. The offset may be set beyond the end of the data, and this does not change the data length. Only writing after setting the pointer beyond the end of the data will change the data size.

Parameters:
pos - The desired offset, in bytes.
Throws:
java.io.IOException - if pos is negative, or if an I/O error is encountered.

length

long length()
            throws java.io.IOException
Gets the number of bytes of data.

Returns:
The number of bytes of data.
Throws:
java.io.IOException - if an I/O error is encountered.