본문 바로가기
1.개발/6.JAVA

[JAVA] byte[] → HexString

by 벅스쭌 2020. 5. 28.
public static String bytesConvertHexString(byte[] buff)
{
    StringBuilder sb = new StringBuilder();
    for (final byte b : buff)
    {
        sb.append(String.format("%02x", b & 0xff));
    }
    return sb.toString();
}

 

반응형

댓글0