Java Files  «Prev  Next»


Lesson 13RandomAccessFile methods
Objective Explore other methods used to randomly access files.

Random Access File Methods

The RandomAccessFile class implements both the DataInput and DataOutput interfaces.
Therefore, reads and writes use methods exactly like the methods of the DataInputStream and DataOutputStream classes, such as read(), readFully(), readBoolean(), writeBoolean(), and so on.
Finally, there are a few miscellaneous methods.

public final FileDescriptor getFD() throws IOException
public int skipBytes(int n) throws IOException
public native void close() throws IOException