前端之家收集整理的这篇文章主要介绍了
我可以用Java写入5GB文件的末尾吗?,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我可以用
Java写入5GB
文件的末尾吗?这个问题出现在我的办公室里,没有人确定答案是什么.
@H_
502_5@
使用
RandomAccessFile应该可以很容易地实现这一点.以下
内容应该有效:
String filename;
RandomAccessFile myFile = new RandomAccessFile(filename,"rw");
// Set write pointer to the end of the file
myFile.seek(myFile.length());
// Write to end of file here