Here you can find the source of printBytes(byte[] data)
public static void printBytes(byte[] data)
//package com.java2s; //License from project: Apache License import javax.xml.bind.*; public class Main { public static void printBytes(byte[] data) { byte[] datum = new byte[1]; for (int i = 0; i < data.length; i++) { datum[0] = data[i];/*from www .ja v a2s .c o m*/ System.out.println(i + " : " + DatatypeConverter.printHexBinary(datum)); } } }