From ff66560910e884f10927f3b07e61f24f52d5e2cc Mon Sep 17 00:00:00 2001 From: Sean Flanigan Date: Sat, 3 Dec 2016 15:12:21 +1000 Subject: [PATCH] JENKINS-26254 Use BufferedInputStream to read .exec files --- .../java/hudson/plugins/jacoco/ExecutionFileLoader.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java b/src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java index 52bba03b..cea75649 100644 --- a/src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java +++ b/src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java @@ -2,9 +2,11 @@ import hudson.FilePath; +import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; @@ -84,14 +86,15 @@ private void loadExecutionData() throws IOException { for (FilePath filePath : execFiles) { File executionDataFile = new File(filePath.getRemote()); try { - final FileInputStream fis = new FileInputStream(executionDataFile); + final InputStream inputStream = new BufferedInputStream( + new FileInputStream(executionDataFile)); try { - final ExecutionDataReader reader = new ExecutionDataReader(fis); + final ExecutionDataReader reader = new ExecutionDataReader(inputStream); reader.setSessionInfoVisitor(sessionInfoStore); reader.setExecutionDataVisitor(executionDataStore); reader.read(); } finally { - fis.close(); + inputStream.close(); } } catch (final IOException e) { System.out.println("While reading execution data-file: " + executionDataFile);