From 9d72311ba0222b9d0489605b8ec2cec711690993 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 21 May 2013 17:42:50 -0400 Subject: [PATCH] [JENKINS-16301] Use a buffered input stream to get somewhat better performance. --- core/src/main/java/hudson/FilePath.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 3dabd48108..cee15b41a7 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -97,6 +97,7 @@ import java.util.zip.GZIPInputStream; import com.sun.jna.Native; import hudson.os.PosixException; +import java.io.BufferedInputStream; import java.util.Enumeration; import java.util.logging.Logger; import org.apache.tools.ant.taskdefs.Chmod; @@ -1663,7 +1664,7 @@ public final class FilePath implements Serializable { return act(new FileCallable() { private static final long serialVersionUID = 1L; public String invoke(File f, VirtualChannel channel) throws IOException { - return Util.getDigestOf(new FileInputStream(f)); + return Util.getDigestOf(new BufferedInputStream(new FileInputStream(f))); } }); } -- GitLab