Here you can find the source of hexDump(PrintStream out, String s, byte b[], int n)
static void hexDump(PrintStream out, String s, byte b[], int n)
//package com.java2s; import java.io.PrintStream; public class Main { static PrintStream strDump; static void hexDump(PrintStream out, String s, byte b[], int n) { if (out == null) return; int i;// ww w.j a v a 2 s . co m out.print(s); for (i = 0; i < n; ++i) { int x = b[i]; if (x < 0) x = 256 + x; s = Integer.toString(x, 16); if (s.length() == 1) s = "0" + s; out.print(s); } out.println(); } static void hexDump(String s, byte b[], int n) { hexDump(strDump, s, b, n); } }