public class RandomAccessFiles extends Object
RandomAccessFile.| Modifier and Type | Method and Description |
|---|---|
static boolean |
contentEquals(RandomAccessFile raf1,
RandomAccessFile raf2)
Tests if two RandomAccessFile contents are equal.
|
static byte[] |
read(RandomAccessFile input,
long position,
int length)
Reads a byte array starting at "position" for "length" bytes.
|
static RandomAccessFile |
reset(RandomAccessFile raf)
Resets the given file to position 0.
|
public static boolean contentEquals(RandomAccessFile raf1, RandomAccessFile raf2) throws IOException
raf1 - A RandomAccessFile.raf2 - Another RandomAccessFile.IOException - if an I/O error occurs.public static byte[] read(RandomAccessFile input, long position, int length) throws IOException
input - The source RandomAccessFile.position - The offset position, measured in bytes from the beginning of the file, at which to set the file pointer.length - How many bytes to read.IOException - If the first byte cannot be read for any reason other than end of file, or if the random access file has been closed, or if some
other I/O error occurs.public static RandomAccessFile reset(RandomAccessFile raf) throws IOException
raf - The RandomAccessFile to reset.IOException - If pos is less than 0 or if an I/O error occurs.