Skip to content

Commit

Permalink
Merge pull request #78 from seanf/JENKINS-26254-use-buffer
Browse files Browse the repository at this point in the history
JENKINS-26254 Use BufferedInputStream to read .exec files
  • Loading branch information
centic9 committed Dec 3, 2016
2 parents c6bf58a + ff66560 commit a35ce73
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a35ce73

Please sign in to comment.