Here you can find the source of asHexString(StringBuilder temp, ByteBuffer buffer)
static StringBuilder asHexString(StringBuilder temp, ByteBuffer buffer)
//package com.java2s; // *| This source code is provided under the Apache 2.0 license -- import java.nio.ByteBuffer; public class Main { static StringBuilder asHexString(StringBuilder temp, ByteBuffer buffer) { int limit = buffer.limit(); for (int i = buffer.position(); i < limit; i++) temp.append(i + 1 == limit ? String.format("%02x", buffer.get(i)) : String.format("%02x ", buffer.get(i))); return temp; }/*from w ww . j a va 2 s . c o m*/ }