Created
December 11, 2012 12:25
-
-
Save myamamic/4258196 to your computer and use it in GitHub Desktop.
[Java] byte[]をString(HEX)に変換する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 適当なので、デバッグ用に | |
*/ | |
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