Java tutorial
//package com.java2s; public class Main { public static String showByteArray(byte[] data) { if (null == data) { return null; } StringBuilder sb = new StringBuilder("{"); for (byte b : data) { sb.append(b).append(","); } sb.deleteCharAt(sb.length() - 1); sb.append("}"); return sb.toString(); } }