Java Reference
In-Depth Information
RandomAccessFile
implements the
read( )
and
write( )
methods. It also implements
the
DataInput
and
DataOuput
interfaces, which means that methods to read and write the
primitive types, such as
readInt( )
and
writeDouble( )
, are available.
Here is an example that demonstrates random-access I/O. It writes six
double
s to a file
and then reads them back in nonsequential order.