当前位置: 首页>>代码示例>>Java>>正文


Java StreamGobbler类代码示例

本文整理汇总了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();
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:17,代码来源:BZip2PipedOutputStream.java


注:本文中的edu.stanford.nlp.util.StreamGobbler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。