public static String readString(ByteBuffer buffer,boolean utf8){
  if (utf8) {
    readLen(buffer);
    int bytesLen=readLen(buffer);
    byte[] bytes=Buffers.readBytes(buffer,bytesLen);
    String str=new String(bytes,CHARSET_UTF_8);
    Buffers.readUByte(buffer);
    return str;
  }
 else {
    int strLen=readLen16(buffer);
    String str=Buffers.readString(buffer,strLen);
    Buffers.readUShort(buffer);
    return str;
  }
}

public static String readString ( ByteBuffer buffer , boolean utf8 ) { if ( utf8 ) { readLen ( buffer ) ; int bytesLen = readLen ( buffer ) ; byte [ ] bytes = Buffers . readBytes ( buffer , bytesLen ) ; String str = new String ( bytes , CHARSET_UTF_8 ) ; Buffers . readUByte ( buffer ) ; return str ; } else { int strLen = readLen16 ( buffer ) ; String str = Buffers . readString ( buffer , strLen ) ; Buffers . readUShort ( buffer ) ; return str ; } }
read string from input buffer . if get eof before read enough data , throw ioexception .
