Monday, 26 August 2013

how to convert bit array into hex contanning 8bits in java

how to convert bit array into hex contanning 8bits in java

I have binary array i converted into hex using
StringBuilder sb = new StringBuilder();
for (byte b : bytes)
{
sb.append(String.format("%02X ", b));
}
System.out.println(sb.toString());
But it gives me hex code for its respective bit.
I want hex containing 8bits. Please help me.

No comments:

Post a Comment