java.lang.Object
com.aoapps.hodgepodge.io.SyncFile
Copies one file to another, only writing the blocks of the destination
file if they either didn't already exist or contain different content.
This is to useful for flash media where reads are much faster than reads and the number of write cycles is limited.
This is also useful for synchronizing data to an LVM snapshot (or a logical volume that has any snapshots), to minimize the allocated copy-on-write space.
- Author:
- AO Industries, Inc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static long
syncFile
(InputStream in, File outFile, RandomAccessFile out) Synchronized the input to the provided output, only writing data that doesn't already match the input.
-
Constructor Details
-
SyncFile
public SyncFile()
-
-
Method Details
-
main
-
syncFile
Synchronized the input to the provided output, only writing data that doesn't already match the input. Returns the number of bytes written.- Throws:
IOException
-