mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-20 12:46:00 +00:00
tweak io block size in FileUtils.appendTo(), referencing performance metrics documented in gnu coreutils (used e.g. for /bin/cat)
This commit is contained in:
@@ -698,7 +698,8 @@ public class FileUtils {
|
||||
}
|
||||
|
||||
public static void appendTo(File fileToAppendTo, File fileToAppendFrom) throws IOException {
|
||||
byte[] buf = new byte[4096];
|
||||
// optimal io block size according to http://lingrok.org/xref/coreutils/src/ioblksize.h
|
||||
byte[] buf = new byte[65536];
|
||||
FileOutputStream out = new FileOutputStream(fileToAppendTo, true);
|
||||
FileInputStream in = new FileInputStream(fileToAppendFrom);
|
||||
for (int n = in.read(buf); n > 0; n = in.read(buf)) {
|
||||
|
||||
Reference in New Issue
Block a user