Here you can find the source of printByteArray(byte[] bytes)
public static void printByteArray(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static void printByteArray(byte[] bytes) { int width = 30; int counter = 0; for (byte b : bytes) { System.out.format("%02X ", b); counter++;// w ww . ja v a 2 s.c o m if (counter > width) { counter = 0; System.out.println(); } } System.out.println(); } }