Hi, I'm writing bytes to temp.fls file. After completing the operation, I want to delete the last 256 bytes from the temp.fls file. How can I achieve this? Please help me.
Thanks in advance.
Hi, I'm writing bytes to temp.fls file. After completing the operation, I want to delete the last 256 bytes from the temp.fls file. How can I achieve this? Please help me.
Thanks in advance.
Use RandomAccessFile.setLength()
like so:
RandomAccessFile f = new RandomAccessFile(yourFile,"rw");
f.setLength(f.length()-256);