Java tutorial
//package com.java2s; public class Main { public static String getHexString(byte[] b) throws Exception { String result = ""; for (int i = 0; i < b.length; i++) { result += Integer.toString((b[i] & 0xFF) + 0x100, 16).substring(1); } return result; } }