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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -