Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Java中使用碎片在硬盘上插入文本_Java_Insert_Hard Drive - Fatal编程技术网

如何在Java中使用碎片在硬盘上插入文本

如何在Java中使用碎片在硬盘上插入文本,java,insert,hard-drive,Java,Insert,Hard Drive,假设我有一个名为foo.txt的文件,其中包含数据 - "this is a sentence" 通过碎片整理工具查看,我可以看到1个区段 我想做的是在不重写数据的情况下在其中插入一些内容,因此它看起来如下所示: - "this is a" - "modified" - "sentence" Java支持3个扩展数据块吗?我想在追加模式下打开文件,看看插入:我不想在内存中插入字符串,但要在硬盘中插入。我不想读取整个文件或重新写入它。

假设我有一个名为foo.txt的文件,其中包含数据

 - "this is a sentence"
通过碎片整理工具查看,我可以看到1个区段

我想做的是在不重写数据的情况下在其中插入一些内容,因此它看起来如下所示:

 - "this is a"
 - "modified"
 - "sentence"

Java支持3个扩展数据块吗?

我想在追加模式下打开文件,看看插入:我不想在内存中插入字符串,但要在硬盘中插入。我不想读取整个文件或重新写入它。