java.lang.Object
com.aoapps.hodgepodge.io.ZeroFile
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static long
zeroFile
(int bpsIn, int bpsOut, File file, RandomAccessFile raf) Zeroes the provided random access file, only writing blocks that contain non-zero.
-
Constructor Details
-
ZeroFile
public ZeroFile()
-
-
Method Details
-
main
-
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
-