public static String readString ( ChannelBuffer buffer , int length ) { return readString ( buffer , length , CharsetUtil . UTF_8 ) ; // char[] chars = new char[length]; // for (int i = 0; i < length; i++) // { // chars[i] = buffer.readChar(); // } // return new String(chars); }
Read a string from a channel buffer with the specified length . It resets the reader index of the buffer to the end of the string .