<<< Sequential vs. Random Access Files, cont. | Index | ByteBuffer >>> |
Class java.nio.channels.FileChannel represents a channel for reading and writing a file
To access Nth record, call
fc.position( ( N - 1 ) * RECORD_SIZE_IN_BYTES );
where N is 1, 2, 3, ...
Note that
(a) records are numbered starting at 0 offset
(b) all records must be of the same length.
<<< Sequential vs. Random Access Files, cont. | Index | ByteBuffer >>> |