public String readStringNullEnd ( final Charset charset ) { int initialPosition = position ; int cnt = 0 ; while ( remaining ( ) > 0 && ( buf [ position ++ ] != 0 ) ) { cnt ++ ; } return new String ( buf , initialPosition , cnt , charset ) ; }
Reads a string from the buffer looks for a 0 to end the string .