In Java using RandomAccessFile
I can create a file and then do setLength
Now Assume I allocate length of 1024 bytes
. Now I wrote say 512 bytes
.
Now again I want to write 256 bytes
without changing size of the file and clearing those 512 bytes
I do not want to use setLength(0)
in the middle of my process to avoid java.io.IOException: No space left on device