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
Post a Comment