Skip to content

Commit 4438b8f

Browse files
committed
PDFBOX-5996: Set size for ByteArrayOutputStreams, as suggested by Axel Howind
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1925304 13f79535-47bb-0310-9956-ffa450edef68
1 parent e6fd4e3 commit 4438b8f

File tree

1 file changed

+1
-1
lines changed
  • pdfbox/src/main/java/org/apache/pdfbox/util

1 file changed

+1
-1
lines changed

pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public static byte[] decodeBase64(String base64Value)
218218
*/
219219
public static byte[] decodeHex(String s)
220220
{
221-
ByteArrayOutputStream baos = new ByteArrayOutputStream();
221+
ByteArrayOutputStream baos = new ByteArrayOutputStream((s.length() + 1) / 2);
222222
int i = 0;
223223
while (i < s.length() - 1)
224224
{

0 commit comments

Comments
 (0)