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