Menu

#8 Semantics of Spawn.getCurrentStandardOutContents()

open
nobody
None
5
2012-03-28
2012-03-28
Bill Black
No

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.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.