public void read ( InputStream in , int lengthToRead ) throws IOException { int read = 0 ; do { grow ( length ) ; read = data . setBytes ( length , in , Math . min ( lengthToRead , data . length ( ) - length ) ) ; length += read ; lengthToRead -= read ; } while ( lengthToRead > 0 ) ; }
Read lengthToRead bytes from the input stream into this array