public static String readPascalString ( final DataInput pStream ) throws IOException { // Get as many bytes as indicated by byte count int length = pStream . readUnsignedByte ( ) ; byte [ ] bytes = new byte [ length ] ; pStream . readFully ( bytes , 0 , length ) ; return new String ( bytes , ENCODING ) ; }
Reads a Pascal String from the given stream . The input stream must be positioned at the length byte of the text which can thus be a maximum of 255 characters long .