Here you can find the source of dumpOctets(byte[] data)
public static void dumpOctets(byte[] data)
//package com.java2s; // This copy of Ice is licensed to you under the terms described in the public class Main { public static void dumpOctets(byte[] data) { final int inc = 8; for (int i = 0; i < data.length; i += inc) { for (int j = i; j - i < inc; j++) { if (j < data.length) { int n = data[j]; if (n < 0) { n += 256;// w ww .j av a 2 s .co m } String s; if (n < 10) { s = " " + n; } else if (n < 100) { s = " " + n; } else { s = "" + n; } System.out.print(s + " "); } else { System.out.print(" "); } } System.out.print('"'); for (int j = i; j < data.length && j - i < inc; j++) { if (data[j] >= (byte) 32 && data[j] < (byte) 127) { System.out.print((char) data[j]); } else { System.out.print('.'); } } System.out.println('"'); } } }