You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2017/05/24 18:41:01 UTC

[13/50] [abbrv] commons-imaging git commit: Refactor duplicate code.

Refactor duplicate code.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/imaging/trunk@1775883 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-imaging/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-imaging/commit/e6799d87
Tree: http://git-wip-us.apache.org/repos/asf/commons-imaging/tree/e6799d87
Diff: http://git-wip-us.apache.org/repos/asf/commons-imaging/diff/e6799d87

Branch: refs/heads/master
Commit: e6799d87f014be14635e9db2e087614b16c87588
Parents: 0ac4d25
Author: Gary D. Gregory <gg...@apache.org>
Authored: Fri Dec 23 18:27:57 2016 +0000
Committer: Gary D. Gregory <gg...@apache.org>
Committed: Fri Dec 23 18:27:57 2016 +0000

----------------------------------------------------------------------
 .../apache/commons/imaging/common/bytesource/ByteSourceFile.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/e6799d87/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceFile.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceFile.java b/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceFile.java
index a48381a..30c745c 100644
--- a/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceFile.java
+++ b/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceFile.java
@@ -64,7 +64,7 @@ public class ByteSourceFile extends ByteSource {
     public byte[] getAll() throws IOException {
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-        try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
+        try (InputStream is = getInputStream()) {
             final byte[] buffer = new byte[1024];
             int read;
             while ((read = is.read(buffer)) > 0) {