Here you can find the source of dumpBuffer(final PrintStream out, final String label, final byte[] b)
public static void dumpBuffer(final PrintStream out, final String label, final byte[] b)
//package com.java2s; import java.io.PrintStream; public class Main { public static void dumpBuffer(final PrintStream out, final String label, final byte[] b) { dumpBuffer(out, label, b, 0, b.length); }// w w w . j a v a 2s . c o m public static void dumpBuffer(final PrintStream out, final byte[] b) { dumpBuffer(out, null, b, 0, b.length); } public static void dumpBuffer(final PrintStream out, final byte[] b, final int offset, final int len) { dumpBuffer(out, null, b, offset, len); } public static void dumpBuffer(final PrintStream out, final String label, final byte[] b, final int offset, final int len) { if (label != null) out.format("-- DUMP -- %s: \n", label); out.format("{\n ", label); for (int j = 0; j < len; ++j) { out.format("%02X", b[j + offset]); if (j + 1 < len) { if ((j + 1) % 8 == 0) out.print("\n "); else out.print(' '); } } out.format("\n}\n"); } }