Editing a 1 MB file continuously, which is more efficient?

I have to constantly edit a 1 MB file, simulating a file system. I have to change the directory of file management blocks, FAT, blocks, etc.

Proffesor recommends overwriting the file every time you upgrade. 1MB should not take minutes to do this, but I do not like it.

Is this FileChannel's way here? Also, I understand that if I edit the MappedByteBuffer , the contents of the displayed file area will also be edited immediately? that is, reflectivity reflects?

Thank.

+3
source share
1 answer

You need RandomAccessFile .

+2

Source: https://habr.com/ru/post/1745585/


All Articles