java - Is there an efficient way to "crop" a file (remove x number of bytes from tail)? -



java - Is there an efficient way to "crop" a file (remove x number of bytes from tail)? -

good afternoon all. wondering how efficiently remove x number of bytes end of file? (inverse operation of append)

reading bytes original file , writing them new file doesn't seem right (fast) if file huge one.

is there way perchance set file length?

or rather, what's best way "crop" file?

randomaccessfile.setlength(long newlength)

java file io

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -