RE: 2 questions |
||
![]() Tr flamebalrog >Also, if not String.format() then how else can I get this output (coz this is about the best way I could come up with). mmhhh...proposed dirty way follows : private String bytesToHexaString(byte[] byteArray) {
StringBuffer str=new StringBuffer(byteArray.length*2);
for (long i=0;i<byteArray.length;i++) {
int currentByte=byteArray[i];
if (currentByte<0)
currentByte+=256;
if (currentByte<16)
str.append('0');
str.append(Integer.toHexString(currentByte));
}
return str.toString();
}
Does it help ?
- Is it a feature or a bug ? - Replies:
|
||
| CyberArmy::Forum v0.6 Generated In 0.02310 seconds |