1 Reply Latest reply: Sep 30, 2010 3:19 AM by EJP RSS

    reading inputstream from the exec process

      I am trying to read a 7zip compressed file in Java. No InputStreamer exists for 7zip compression, so I read it using Process.exec:

      Process proc = shell.exec("7z x very_big_file.7z -so ");

      BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
      while(br.ready()) {

      Question: if I drop the sleep command above, the buffer is not ready, and I do not get any strings from the executed process. How can I force the reader to check wheather EOF is reached, and not wheather the the buffer is ready?