Java tutorial
//package com.java2s; public class Main { public static String logBytes(byte[] ucPtr) { String s; final StringBuffer sb = new StringBuffer(); for (int i = 0; i < ucPtr.length; ++i) { if (0 == i) { s = ""; } else { s = ", "; } s += String.valueOf(ucPtr[i]); sb.append(s); } return sb.toString(); } }