Here you can find the source of toHex(byte[] bytes)
Parameter | Description |
---|---|
num | a parameter |
public static String toHex(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w .jav a2 s .c o m*/ * @param num * @return */ public static String toHex(byte[] bytes) { StringBuilder retString = new StringBuilder(); for (int i = 0; i < bytes.length; ++i) { retString.append(Integer.toHexString(0x0100 + (bytes[i] & 0x00FF)).substring(1)); } return retString.toString(); } }