Package com.aoindustries.io
Class ZeroFile
- java.lang.Object
-
- com.aoindustries.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 Summary
Constructors Constructor Description ZeroFile()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(String[] args)static longzeroFile(int bpsIn, int bpsOut, RandomAccessFile raf)Zeroes the provided random access file, only writing blocks that contain non-zero.
-
-
-
Method Detail
-
main
public static void main(String[] args)
-
zeroFile
public static long zeroFile(int bpsIn, int bpsOut, RandomAccessFile raf) throws IOExceptionZeroes 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
-
-