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

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

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