Here you can find the source of printBytes(byte[] buffer, int start, int length)
public static String printBytes(byte[] buffer, int start, int length)
//package com.java2s; //License from project: Apache License public class Main { public static String printBytes(byte[] buffer, int start, int length) { StringBuilder sb = new StringBuilder(length - start); for (int i = start; i < start + length; i++) { sb.append(String.format("%%%02x", buffer[i])); }/*from www . ja v a2s .com*/ return sb.toString(); } }