Here you can find the source of dumpBytes(byte[] bytes)
public static String dumpBytes(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static String dumpBytes(byte[] bytes) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < bytes.length; i++) { int unsignedInt = 0xFF & bytes[i]; if (unsignedInt < 0x10) { sb.append("0"); }//from w w w.ja va 2 s . co m sb.append(Integer.toHexString(unsignedInt)); } return sb.toString(); } }