Skip to content

Commit 684be71

Browse files
committed
removed use of String.format
1 parent 8f46494 commit 684be71

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pg/src/test/java/org/bouncycastle/test/DumpUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.bouncycastle.test;
22

3+
import org.bouncycastle.util.Pack;
34
import org.bouncycastle.util.encoders.Hex;
45

56
public class DumpUtil
@@ -43,10 +44,13 @@ public static String hexdump(int startIndent, byte[] array)
4344

4445
StringBuilder out = new StringBuilder();
4546
int l = 0;
47+
byte[] counterLabel = new byte[4];
48+
4649
while (l < octets.length)
4750
{
4851
// index row
49-
out.append(String.format("%08X", l)).append(" ");
52+
Pack.intToBigEndian(l, counterLabel, 0);
53+
out.append(Hex.toHexString(counterLabel)).append(" ");
5054
// first 8 octets of a line
5155
for (int i = l ; i < l + 8 && i < octets.length; i++)
5256
{

0 commit comments

Comments
 (0)