本文整理汇总了Java中edu.stanford.nlp.util.StreamGobbler类的典型用法代码示例。如果您正苦于以下问题:Java StreamGobbler类的具体用法?Java StreamGobbler怎么用?Java StreamGobbler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StreamGobbler类属于edu.stanford.nlp.util包,在下文中一共展示了StreamGobbler类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BZip2PipedOutputStream
import edu.stanford.nlp.util.StreamGobbler; //导入依赖的package包/类
public BZip2PipedOutputStream(String filename, OutputStream err) throws IOException {
String bzip2 = System.getProperty("bzip2", "bzip2");
String cmd = bzip2; // + " > " + filename;
//System.err.println("getBZip2PipedOutputStream: Running command: "+cmd);
ProcessBuilder pb = new ProcessBuilder();
pb.command(cmd);
this.process = pb.start();
this.filename = filename;
OutputStream outStream = new FileOutputStream(filename);
errWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(err)));
outGobbler = new ByteStreamGobbler("Output stream gobbler: " + cmd + " " + filename,
process.getInputStream(), outStream);
errGobbler = new StreamGobbler(process.getErrorStream(), errWriter);
outGobbler.start();
errGobbler.start();
}