本文整理汇总了Java中edu.stanford.nlp.util.StreamGobbler.start方法的典型用法代码示例。如果您正苦于以下问题:Java StreamGobbler.start方法的具体用法?Java StreamGobbler.start怎么用?Java StreamGobbler.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.stanford.nlp.util.StreamGobbler
的用法示例。
在下文中一共展示了StreamGobbler.start方法的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();
}