Interface IRandomAccessFile

    • Method Detail

      • getByteOrder

        java.nio.ByteOrder getByteOrder()
        Gets the byte-order (endiness) of the random access file. Default is network-byte order (big-endian).
      • setByteOrder

        void setByteOrder​(java.nio.ByteOrder byteOrder)
        Sets the byte-order (endiness) of the random access file.
      • getFilePointer

        long getFilePointer()
                     throws IOExceptionUnchecked
        Returns the current offset in this file.
        Returns:
        the offset from the beginning of the file, in bytes, at which the next read or write occurs.
        Throws:
        IOExceptionUnchecked - if an I/O error occurs.
      • seek

        void seek​(long pos)
           throws IOExceptionUnchecked
        Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not change the file length. The file length will change only by writing after the offset has been set beyond the end of the file.
        Parameters:
        pos - the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
        Throws:
        IOExceptionUnchecked - if pos is less than 0 or if an I/O error occurs.
      • setLength

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

        If the present length of the file as returned by the length method is greater than the newLength argument then the file will be truncated. In this case, if the file offset as returned by the getFilePointer method is greater than newLength then after this method returns the offset will be equal to newLength.

        If the present length of the file as returned by the length method is smaller than the newLength argument then the file will be extended. In this case, the contents of the extended portion of the file are not defined.

        Parameters:
        newLength - The desired length of the file
        Throws:
        IOExceptionUnchecked - If an I/O error occurs
      • readFully

        void readFully​(byte[] b,
                       int off,
                       int len)
                throws IOExceptionUnchecked
        Specified by:
        readFully in interface java.io.DataInput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataInput.readFully(byte[], int, int)
      • readUnsignedByte

        int readUnsignedByte()
                      throws IOExceptionUnchecked
        Specified by:
        readUnsignedByte in interface java.io.DataInput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataInput.readUnsignedByte()
      • readUnsignedShort

        int readUnsignedShort()
                       throws IOExceptionUnchecked
        Specified by:
        readUnsignedShort in interface java.io.DataInput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataInput.readUnsignedShort()
      • writeBoolean

        void writeBoolean​(boolean v)
                   throws IOExceptionUnchecked
        Specified by:
        writeBoolean in interface java.io.DataOutput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataOutput.writeBoolean(boolean)
      • writeDouble

        void writeDouble​(double v)
                  throws IOExceptionUnchecked
        Specified by:
        writeDouble in interface java.io.DataOutput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataOutput.writeDouble(double)
      • writeBytes

        void writeBytes​(java.lang.String s)
                 throws IOExceptionUnchecked
        Specified by:
        writeBytes in interface java.io.DataOutput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataOutput.writeBytes(String)
      • writeChars

        void writeChars​(java.lang.String s)
                 throws IOExceptionUnchecked
        Specified by:
        writeChars in interface java.io.DataOutput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataOutput.writeChars(String)
      • writeUTF

        void writeUTF​(java.lang.String str)
               throws IOExceptionUnchecked
        Specified by:
        writeUTF in interface java.io.DataOutput
        Throws:
        IOExceptionUnchecked
        See Also:
        DataOutput.writeUTF(String)