org.deckfour.xes.nikefs2
Interface NikeFS2RandomAccessStorage

All Superinterfaces:
DataInput, DataOutput
All Known Implementing Classes:
NikeFS2LazyRandomAccessStorageImpl, NikeFS2RandomAccessStorageImpl

public interface NikeFS2RandomAccessStorage
extends DataOutput, DataInput

This interface specifies a random acess data storage container, pretty much the same as java.util.RandomAccessFile.

Author:
Christian W. Guenther (christian@deckfour.org)

Method Summary
 void close()
          Closes the data storage container.
 NikeFS2RandomAccessStorage copy()
          Creates a clone, or copy, of this storage, having the exact same contents and the file pointer reset to zero.
 long getFilePointer()
          Returns the current file pointer of the storage container.
 long length()
          Returns the length, or size, in number of bytes currently used by this instance.
 void seek(long pos)
          Repositions the offset, or file pointer, at which the next read or write operation will occur.
 int skipBytes(int n)
          Moves the offset, or file pointer, a specified number of bytes towards the end of the storage container.
 
Methods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF
 

Method Detail

close

void close()
           throws IOException
Closes the data storage container. After this method has been invoked, no further access to the represented instance is allowed.

Throws:
IOException

getFilePointer

long getFilePointer()
                    throws IOException
Returns the current file pointer of the storage container. A file pointer is the offset in bytes, from the beginning of the sequential byte storage, at which the next read or write operation would occur.

Returns:
Offset in bytes from beginning of storage.
Throws:
IOException

length

long length()
            throws IOException
Returns the length, or size, in number of bytes currently used by this instance.

Returns:
Number of bytes currently allocated.
Throws:
IOException

seek

void seek(long pos)
          throws IOException
Repositions the offset, or file pointer, at which the next read or write operation will occur.

Parameters:
pos - The offset in bytes, at which the next operation will occur.
Throws:
IOException

skipBytes

int skipBytes(int n)
              throws IOException
Moves the offset, or file pointer, a specified number of bytes towards the end of the storage container.

Specified by:
skipBytes in interface DataInput
Throws:
IOException

copy

NikeFS2RandomAccessStorage copy()
                                throws IOException
Creates a clone, or copy, of this storage, having the exact same contents and the file pointer reset to zero.

Throws:
IOException