java - Delete file contents using RandomAccessFile -


i have file contains lot of zeros , per requirement zeros in file invalid. using randomaccessfile api locate data in file. there way zeros can removed file using same api.

you'll have stream through file , write out content, minus zeros, separate temporary file. can close , delete original , rename new file old file name. that's best alternative particular use case.


Comments

Popular posts from this blog

css - I want to align grid in center -

python - SWIG function not printing output -

oop - Function for all prototypes - Javascript -