Axel Howind created PDFBOX-5999: ----------------------------------- Summary: fix initial ByteArrayOutputStream size for deflate operation Key: PDFBOX-5999 URL: https://issues.apache.org/jira/browse/PDFBOX-5999 Project: PDFBox Issue Type: Bug Reporter: Axel Howind Attachments: fix_initial_ByteArrayOutputStream_size.patch
When I re-checked my last patch about initializing ByteArrayOutputStream instances with the matching size, I saw that I confused the deflate and inflate operations. Here the resulting array can be expected less in size than the original array: ``` ByteArrayOutputStream deflated = new ByteArrayOutputStream(Math.max(32, data.length / 2)); ``` The patch fixes this and allocates half the size of the deflater input. This should be a good enough estimate in most cases. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org