Java tutorial
//package com.java2s; public class Main { public static String ByteArrayToString(byte[] arr) { StringBuffer sb = new StringBuffer(); for (byte item : arr) { sb.append(String.format("%02X ", item & 0xFF)); } return "{ " + sb.toString() + "}"; } }