Class ZeroFile

java.lang.Object
com.aoapps.hodgepodge.io.ZeroFile

public class ZeroFile extends Object
Zeros-out a file, only writing the blocks of the destination that contain any non-zero value. This is to clear flash media with minimal writes.
Author:
AO Industries, Inc.
  • Constructor Details

    • ZeroFile

      public ZeroFile()
  • Method Details

    • main

      public static void main(String[] args)
    • zeroFile

      public static long zeroFile(int bpsIn, int bpsOut, File file, RandomAccessFile raf) throws IOException
      Zeroes the provided random access file, only writing blocks that contain non-zero. Reads at the maximum provided bpsIn blocks per second. Writes at the maximum provided bpsOut blocks per second. Returns the number of bytes written.
      Throws:
      IOException