Java tutorial
//package com.java2s; public class Main { public static String toHexString(final byte[] src) { StringBuffer buf = new StringBuffer(); for (byte b : src) { String s = String.format("%02x", b & 0xff); buf.append(s).append(","); } return buf.toString(); } }