Class 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 Detail

      • ZeroFile

        public ZeroFile()
    • Method Detail

      • main

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

        public static long zeroFile​(int bpsIn,
                                    int bpsOut,
                                    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