File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
pdfbox/src/main/java/org/apache/pdfbox Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ public static FDFDocument loadFDF(InputStream input) throws IOException
119119 */
120120 public static FDFDocument loadXFDF (String filename ) throws IOException
121121 {
122- return Loader .loadXFDF (new BufferedInputStream ( new FileInputStream ( filename ) ));
122+ return Loader .loadXFDF (new File ( filename ));
123123 }
124124
125125 /**
@@ -133,7 +133,10 @@ public static FDFDocument loadXFDF(String filename) throws IOException
133133 */
134134 public static FDFDocument loadXFDF (File file ) throws IOException
135135 {
136- return Loader .loadXFDF (new BufferedInputStream (new FileInputStream (file )));
136+ try (InputStream is = new BufferedInputStream (new FileInputStream (file )))
137+ {
138+ return Loader .loadXFDF (is );
139+ }
137140 }
138141
139142 /**
You can’t perform that action at this time.
0 commit comments