Here you can find the source of hex(final byte[] bytes)
public static String hex(final byte[] bytes)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.DatatypeConverter; public class Main { public static String hex(final byte[] bytes) { return DatatypeConverter.printHexBinary(bytes); }/* w w w. j a v a 2 s . c o m*/ public static byte[] hex(final String str) { return DatatypeConverter.parseHexBinary(str); } }