java - InputStream blocks when reading large amount of data from external process -


i have problem getting data prom process.exec()
there process must call java, can work long time, , process can produce large amount of data.
doing this:

public inputstream exec() throws ioexception, interruptedexception{     processbuilder pb = new processbuilder(args);     process p = pb.start();     p.waitfor();     return p.getinputstream(); } 

this code blocks after runs time. assume inputstream buffer being filled, , it's waiting me read it.
want return inputstream since output can, not must, compressed, decompress output later, , must read output byte output stream
how can run process , it's output data?


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -