question: 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 ; } }
target:  Read string from input buffer. if get EOF before read enough data, throw IOException.