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 <[email protected]> Authored: Fri Dec 23 18:27:57 2016 +0000 Committer: Gary D. Gregory <[email protected]> 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) {
