You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2017/06/07 15:24:39 UTC

svn commit: r1797939 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java

Author: tilman
Date: Wed Jun  7 15:24:39 2017
New Revision: 1797939

URL: http://svn.apache.org/viewvc?rev=1797939&view=rev
Log:
PDFBOX-2852: simplify code

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java?rev=1797939&r1=1797938&r2=1797939&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java Wed Jun  7 15:24:39 2017
@@ -37,12 +37,7 @@ final class ASCII85Filter extends Filter
         try
         {
             is = new ASCII85InputStream(encoded);
-            byte[] buffer = new byte[1024];
-            int amountRead;
-            while((amountRead = is.read(buffer, 0, 1024))!= -1)
-            {
-                decoded.write(buffer, 0, amountRead);
-            }
+            IOUtils.copy(is, decoded);
             decoded.flush();
         }
         finally
@@ -57,12 +52,7 @@ final class ASCII85Filter extends Filter
         throws IOException
     {
         ASCII85OutputStream os = new ASCII85OutputStream(encoded);
-        byte[] buffer = new byte[1024];
-        int amountRead;
-        while((amountRead = input.read(buffer, 0, 1024))!= -1)
-        {
-            os.write(buffer, 0, amountRead);
-        }
+        IOUtils.copy(input, os);
         os.close();
         encoded.flush();
     }