Here you can find the source of dump(byte[] str)
static public String dump(byte[] str)
//package com.java2s; public class Main { static public String dump(byte[] str) { if (str == null) return null; StringBuilder data = new StringBuilder(); for (byte b : str) { String hex = Integer.toHexString((int) b); data.append(hex); //System.out.print(hex); }/*from w w w . j av a 2 s.c o m*/ return data.toString(); } }