public static String readNullTerminatedString ( DataInput in ) throws IOException , EOFException { StringBuilder s = new StringBuilder ( ) ; while ( true ) { int b = in . readByte ( ) ; if ( b == 0 ) { break ; } s . append ( ( char ) b ) ; } return s . toString ( ) ; }
Reads a null - terminated string of bytes from the specified input .