pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1861410 - /pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/ui/Tree.java
Date Sat, 15 Jun 2019 16:27:08 GMT
Author: tilman
Date: Sat Jun 15 16:27:08 2019
New Revision: 1861410

URL: http://svn.apache.org/viewvc?rev=1861410&view=rev
Log:
PDFBOX-4071: SonarQube fix

Modified:
    pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/ui/Tree.java

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/ui/Tree.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/ui/Tree.java?rev=1861410&r1=1861409&r2=1861410&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/ui/Tree.java (original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/ui/Tree.java Sat Jun 15
16:27:08 2019
@@ -310,16 +310,15 @@ public class Tree extends JTree
             {
                 try
                 {
-                    byte[] bytes = IOUtils.toByteArray(cosStream.createInputStream());
                     File temp = File.createTempFile("pdfbox", "." + extension);
                     temp.deleteOnExit();
 
-                    try (FileOutputStream outputStream = new FileOutputStream(temp))
+                    try (InputStream is = cosStream.createInputStream();
+                         FileOutputStream os = new FileOutputStream(temp))
                     {
-                        outputStream.write(bytes);
-
-                        Desktop.getDesktop().open(temp);
+                        IOUtils.copy(is, os);
                     }
+                    Desktop.getDesktop().open(temp);
                 }
                 catch (IOException e)
                 {



Mime
View raw message