I am writing some implementation of a data access test, and I need random access to the contents of the file. Here is the code:
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rwd");
final byte b[] = IOUtils.toByteArray(source);
randomAccessFile.write(b, (int) offset, size);
where offset is of type long. Why does the RandomAccessFile method not provide a method:
public void write(byte b[], long off, int len)
?
How to override this problem?
source
share