In my byte array I have the hash values of a message which consists of some negative values and also positive values. Positive values are being printed easily by us
How about Arrays.toString(byteArray)?
Here's some compilable code:
byte[] byteArray = new byte[] { -1, -128, 1, 127 }; System.out.println(Arrays.toString(byteArray));
Output:
[-1, -128, 1, 127]
Why re-invent the wheel...