Constructors
| Name | Description |
|---|---|
| RandomAccessFile(File, String) | Creates a random access file stream to read from, and optionally to write to, the file specified by the File argument. |
| RandomAccessFile(String, String) | Creates a random access file stream to read from, and optionally to write to, a file with the specified name. |
Methods
| Name | Description |
|---|---|
| close() | Closes this random access file stream and releases any system resources associated with the stream. |
| getFD() | Returns the opaque file descriptor object associated with this stream. |
| getFilePointer() | Returns the current offset in this file. |
| length() | Returns the length of this file. |
| read() | Reads a byte of data from this file. |
| read(byte[]) | Reads up to b.length bytes of data from this file into an array of bytes. |
| read(byte[], int, int) | Reads up to len bytes of data from this file into an array of bytes. |
| readBoolean() | Reads a boolean from this file. |
| readByte() | Reads a signed 8-bit value from this file. |
| readChar() | Reads a Unicode character from this file. |
| readDouble() | Reads a double from this file. |
| readFloat() | Reads a float from this file. |
| readFully(byte[]) | Reads b.length bytes from this file into the byte array. |
| readFully(byte[], int, int) | Reads exactly len bytes from this file into the byte array. |
| readInt() | Reads a signed 32-bit integer from this file. |
| readLine() | Reads the next line of text from this file. |
| readLong() | Reads a signed 64-bit integer from this file. |
| readShort() | Reads a signed 16-bit number from this file. |
| readUnsignedByte() | Reads an unsigned 8-bit number from this file. |
| readUnsignedShort() | Reads an unsigned 16-bit number from this file. |
| readUTF() | Reads in a string from this file. |
| seek(long) | Sets the offset from the beginning of this file at which the next read or write occurs. |
| skipBytes(int) | Skips exactly n bytes of input. |
| write(byte[]) | Writes b.length bytes from the specified byte array starting at offset off to this file. |
| write(byte[], int, int) | Writes len bytes from the specified byte array starting at offset off to this file. |
| write(int) | Writes the specified byte to this file. |
| writeBoolean(boolean) | Writes a boolean to the file as a 1-byte value. |
| writeByte(int) | Writes a byte to the file as a 1-byte value. |
| writeBytes(String) | Writes the string to the file as a sequence of bytes. |
| writeChar(int) | Writes a char to the file as a 2-byte value, high byte first. |
| writeChars(String) | Writes a string to the file as a sequence of characters. |
| writeDouble(double) | Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the file as an 8-byte quantity, high byte first. |
| writeFloat(float) | Converts the float argument to an int using the floatToIntBits method in class Float, and then writes that int value to the file as a 4-byte quantity, high byte first. |
| writeInt(int) | Writes an int to the file as four bytes, high byte first. |
| writeLong(long) | Writes a long to the file as eight bytes, high byte first. |
| writeShort(int) | Writes a short to the file as two bytes, high byte first. |
| writeUTF(String) | Writes a string to the file using UTF-8 encoding in a machine-independent manner. |