class ByteBufferUtils {

    public static String readString(ByteBuffer buffer)throws CharacterCodingException
    {
        int position = buffer.position();
        CharBuffer charBuffer = DECODER.decode(buffer);
        buffer.position(position);
        return charBuffer.toString();
    }

}