Here you can find the source of dumpArrayHex(byte b[])
public static String dumpArrayHex(byte b[])
//package com.java2s; //License from project: Open Source License public class Main { public static String dumpArrayHex(byte b[]) { return dumpArrayHex(b, 0, b.length); }//from w ww . j a v a2s . c o m public static String dumpArrayHex(byte b[], int pos, int len) { StringBuilder sb = new StringBuilder(); sb.append('['); for (int i = pos; i < len; i++) { if (i > 0) sb.append(","); sb.append(Integer.toHexString(b[i] & 0xff)); } sb.append(']'); return sb.toString(); } }