diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2014-10-13 00:23:13 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2014-10-13 00:23:13 +0000 |
commit | f8ba282d71706527ae6c2b787d2abc407276475f (patch) | |
tree | 59d9bace2e4075e40b2699605bb816cb044603ab /src/main/java | |
parent | ec37e5c5731303188ef60f3aef064a51bb585747 (diff) | |
download | jackcess-f8ba282d71706527ae6c2b787d2abc407276475f.tar.gz jackcess-f8ba282d71706527ae6c2b787d2abc407276475f.zip |
more unit test perf tweaks
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@890 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/ByteUtil.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/ByteUtil.java b/src/main/java/com/healthmarketscience/jackcess/impl/ByteUtil.java index 67f0724..5736bb3 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/ByteUtil.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/ByteUtil.java @@ -450,7 +450,12 @@ public final class ByteUtil { public static String toHexString(ByteBuffer buffer, int offset, int size, boolean formatted) { - StringBuilder rtn = new StringBuilder(); + int bufLen = size * 2; + if(formatted) { + bufLen += size + + (7 * ((size + NUM_BYTES_PER_LINE - 1) / NUM_BYTES_PER_LINE)); + } + StringBuilder rtn = new StringBuilder(bufLen); int position = buffer.position(); buffer.position(offset); size = Math.min(size, buffer.remaining()); |