Semantics of Spawn.getCurrentStandardOutContents()
Brought to you by:
johanwalles,
kerneldebugger
Instead of returning the process' output since starting, I wonder if it would not be more useful to return only the output accumulated since the last call to this method.
I'm interested in using this to control a precompiled process with a significant start-up time on hundreds of sentences from thousands of documents in a single run, so I only want the output of the last command I issued each time. I've downloaded the source and redefined StreamPiper.getCurrentContents()
synchronized String getCurrentContents() {
String toReturn = sCurrentOut.toString();
sCurrentOut = new StringBuffer();
return toReturn;
}
and it seems to be doing what I'd prefer.