Skip to content

Commit

Permalink
Using BufferedInputStream and BufferedOutputStream to copy streams in…
Browse files Browse the repository at this point in the history
…creases throughput (fixes #65)
  • Loading branch information
Vincent Partington committed Jan 23, 2013
1 parent 83edcc8 commit 71746cc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/
package com.xebialabs.overthere.util;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -155,12 +157,12 @@ private static void copyFile(final OverthereFile srcFile, final OverthereFile ds
ByteStreams.copy(new InputSupplier<InputStream>() {
@Override
public InputStream getInput() throws IOException {
return srcFile.getInputStream();
return new BufferedInputStream(srcFile.getInputStream());
}
}, new OutputSupplier<OutputStream>() {
@Override
public OutputStream getOutput() throws IOException {
return dstFile.getOutputStream();
return new BufferedOutputStream(dstFile.getOutputStream());
}
});
} catch (IOException exc) {
Expand Down

0 comments on commit 71746cc

Please sign in to comment.