Interface NikeFS2RandomAccessStorage

  • All Superinterfaces:
    java.io.DataInput, java.io.DataOutput
    All Known Implementing Classes:
    NikeFS2LazyRandomAccessStorageImpl, NikeFS2RandomAccessStorageImpl

    public interface NikeFS2RandomAccessStorage
    extends java.io.DataOutput, java.io.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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.DataInput

        readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF
      • 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 java.io.IOException
        Closes the data storage container. After this method has been invoked, no further access to the represented instance is allowed.
        Throws:
        java.io.IOException
      • getFilePointer

        long getFilePointer()
                     throws java.io.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:
        java.io.IOException
      • length

        long length()
             throws java.io.IOException
        Returns the length, or size, in number of bytes currently used by this instance.
        Returns:
        Number of bytes currently allocated.
        Throws:
        java.io.IOException
      • seek

        void seek​(long pos)
           throws java.io.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:
        java.io.IOException
      • skipBytes

        int skipBytes​(int n)
               throws java.io.IOException
        Moves the offset, or file pointer, a specified number of bytes towards the end of the storage container.
        Specified by:
        skipBytes in interface java.io.DataInput
        Throws:
        java.io.IOException
      • copy

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