Here you can find the source of readAlexString(ByteBuffer buffer)
public final static String readAlexString(ByteBuffer buffer)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public final static String readAlexString(ByteBuffer buffer) { int count = buffer.get() & 0xfff; byte bytes[] = new byte[count]; buffer.get(bytes, 0, count);/*from w w w .j a va 2 s .c o m*/ return new String(bytes); } }