Skip to content

Commit

Permalink
Close FileInputStream safely in ZUGFeRDExporterFromPDFA
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte-Neu committed Dec 3, 2024
1 parent 7c9f172 commit 4fce6aa
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public IZUGFeRDExporter getExporter() {
}

protected byte[] filenameToByteArray(String pdfFilename) throws IOException {
FileInputStream fileInputStream = new FileInputStream(pdfFilename);
return inputstreamToByteArray(fileInputStream);
try (FileInputStream fileInputStream = new FileInputStream(pdfFilename)) {
return inputstreamToByteArray(fileInputStream);
}
}

protected byte[] inputstreamToByteArray(InputStream fileInputStream) throws IOException {
Expand Down

0 comments on commit 4fce6aa

Please sign in to comment.