Here you can find the source of printBytes(byte[] bytes)
public static void printBytes(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static void printBytes(byte[] bytes) { printBytes(bytes, 0, bytes.length); }/* www .java2s . c o m*/ public static void printBytes(byte[] bytes, int length) { printBytes(bytes, 0, length); } public static synchronized void printBytes(byte[] bytes, int start, int length) { System.err.println(Thread.currentThread().getName() + ">>>>>>>>>>>"); for (int i = start; i < length; i++) { if (i > 0 && i % 32 == 0) System.err.println(); int p = bytes[i] & 0xFF; if (p < 16) System.err.print("0"); System.err.print(Integer.toHexString(p).toUpperCase()); System.err.print(" "); } System.err.println(); } }