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 -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -