Here you can find the source of dumpByteArray(byte[] bytes)
public static void dumpByteArray(byte[] bytes)
//package com.java2s; /*/*from w ww . jav a2 s . c o m*/ * Copyright (c) 2015, GoMint, BlackyPaw and geNAZt * * This code is licensed under the BSD license found in the * LICENSE file in the root directory of this source tree. */ public class Main { public static void dumpByteArray(byte[] bytes) { int count = 0; StringBuilder stringBuilder = new StringBuilder(); for (byte aByte : bytes) { String hex = Integer.toHexString(aByte & 255); if (hex.length() == 1) { hex = "0" + hex; } stringBuilder.append(hex).append(" "); if (count++ == 16) { stringBuilder.append("\n"); count = 0; } } System.out.println(stringBuilder); } }