backport to java 8

This commit is contained in:
jstaerk
2023-11-26 18:14:17 +01:00
parent c944072e2f
commit 80f5e796cd

View File

@@ -62,7 +62,11 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
private byte[] fileToByteArrayInputStream(String pdfFilename) throws IOException { private byte[] fileToByteArrayInputStream(String pdfFilename) throws IOException {
FileInputStream fileInputStream = new FileInputStream(pdfFilename); FileInputStream fileInputStream = new FileInputStream(pdfFilename);
return fileInputStream.readAllBytes(); fileInputStream.reset();
byte[] bytes = new byte[fileInputStream.available()];
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
dataInputStream.readFully(bytes);
return bytes;
} }
/*** /***