private static String hex(byte[] arr) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < arr.length; ++i) {
            sb.append(Integer.toHexString((arr[i] & 0xFF) | 0x100).substring(1,
                    3));
        }
        return sb.toString();
    }
private static String hex(byte[] arr) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < arr.length; ++i) {
            sb.append(Integer.toHexString((arr[i] & 0xFF) | 0x100).substring(1,
                    3));
        }
        return sb.toString();
    }
private static String hex ( byte [ ] arr ) { StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < arr . length ; ++ i ) { sb . append ( Integer . toHexString ( ( arr [ i ] & 0xFF ) | 0x100 ) . substring ( 1 , 3 ) ) ; } return sb . toString ( ) ; }
字节转换为16进制

@param arr
字节数组
@return 16进制字 串
字节转换为16进制