Skip to content

Instantly share code, notes, and snippets.

@myamamic
Created December 11, 2012 12:25
Show Gist options
  • Save myamamic/4258196 to your computer and use it in GitHub Desktop.
Save myamamic/4258196 to your computer and use it in GitHub Desktop.
[Java] byte[]をString(HEX)に変換する
/*
* 適当なので、デバッグ用に
*/
private static String dump(byte[] buf) {
String str = new String();
for (int i = 0; i < buf.length; i++) {
str = str + Integer.toHexString(buf[i] & 0xff);
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment