Good afternoon all. I was wondering how do we efficiently remove x number of bytes from the end of a file? (inverse operation of append)
Reading the bytes from the original file and writing them to a new file just doesn’t seem right (fast) especially if the file is a huge one.
Is there a way we could possibly set the file length?
Or rather, what’s the best way to “crop” a file?
RandomAccessFile.setLength(long newLength)