我正在编写一些数据访问测试实现,我需要随机访问文件内容。这是代码:
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rwd");
final byte b[] = IOUtils.toByteArray(source);
randomAccessFile.write(b, (int) offset, size);
其中 offset 的类型为 long。为什么 RandomAccessFile 不提供方法:
public void write(byte b[], long off, int len)
?
如何覆盖这个问题?