Skip to content

Commit

Permalink
updated history. got rid of one more readallbytes
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaerk committed Nov 26, 2023
1 parent 656fec6 commit 771fbba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 8 additions & 7 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
2.9.0
=======
2023-11-27

Missing closing tag in BankDetails when there's no BIC number #339
ZUGFeRDExporterFromA3 did not set default ZUGFeRD Version
Have a way to merge to PDF file without knowing if it is A-1 or A-3 #341
Be able to validate XR 3.0 #347
- Missing closing tag in BankDetails when there's no BIC number #339
- ZUGFeRDExporterFromA3 did not set default ZUGFeRD Version
- Have a way to merge to PDF file without knowing if it is A-1 or A-3 #341
- Be able to validate XR 3.0 #347

2.8.0
=======
2023-09-14

Improvement of included notes #331
fixes #259 by Heavenfighter
introduction of --disable-file-logging command line option
- Improvement of included notes #331
- fixes #259 by Heavenfighter
- introduction of --disable-file-logging command line option

2.7.3
=======
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ protected IZUGFeRDExporter getExporter() {
return theExporter;
}

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

protected byte[] inputstreamToByteArray(InputStream fileInputStream) throws IOException {
byte[] bytes = new byte[fileInputStream.available()];
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
dataInputStream.readFully(bytes);
Expand Down Expand Up @@ -105,7 +109,7 @@ private int getPDFAVersion(byte[] byteArrayInputStream) throws IOException {
* @throws IOException
*/
public IZUGFeRDExporter load(String pdfFilename) throws IOException {
determineAndSetExporter(getPDFAVersion(fileToByteArrayInputStream(pdfFilename)));
determineAndSetExporter(getPDFAVersion(filenameToByteArray(pdfFilename)));
return theExporter.load(pdfFilename);
}

Expand Down Expand Up @@ -133,7 +137,7 @@ public IZUGFeRDExporter load(byte[] pdfBinary) throws IOException {
* @throws IOException if anything is wrong with inputstream
*/
public IZUGFeRDExporter load(InputStream pdfSource) throws IOException {
determineAndSetExporter(getPDFAVersion(pdfSource.readAllBytes()));
determineAndSetExporter(getPDFAVersion(inputstreamToByteArray(pdfSource)));
return theExporter.load(pdfSource);
}

Expand Down

0 comments on commit 771fbba

Please sign in to comment.