Here you can find the source of asStr(ByteBuffer buff)
public static String asStr(ByteBuffer buff)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { public static String asStr(ByteBuffer buff) { return new String(buff.array(), buff.arrayOffset() + buff.position(), buff.limit()); }//w w w . ja v a2 s.com }