Here you can find the source of toHexString(byte[] paramArrayOfByte)
public static String toHexString(byte[] paramArrayOfByte)
//package com.java2s; //License from project: Open Source License public class Main { private static final char[] HEX_DIGITS = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102 }; public static String toHexString(byte[] paramArrayOfByte) { if (paramArrayOfByte == null) return ""; StringBuilder localStringBuilder = new StringBuilder( paramArrayOfByte.length << 1); for (int i = 0;; i++) { if (i >= paramArrayOfByte.length) return localStringBuilder.toString(); localStringBuilder/*from w ww . j a va 2 s. c om*/ .append(HEX_DIGITS[((0xF0 & paramArrayOfByte[i]) >>> 4)]); localStringBuilder .append(HEX_DIGITS[(0xF & paramArrayOfByte[i])]); } } }