Example usage for org.apache.commons.exec InputStreamPumper InputStreamPumper

List of usage examples for org.apache.commons.exec InputStreamPumper InputStreamPumper

Introduction

In this page you can find the example usage for org.apache.commons.exec InputStreamPumper InputStreamPumper.

Prototype

public InputStreamPumper(final InputStream is, final OutputStream os) 

Source Link

Document

Create a new stream pumper.

Usage

From source file:com.example.gridtest.MyPumpStreamHandler.java

/**
 * Creates a stream pumper to copy the given input stream to the given
 * output stream./*w  ww  .  j  av a 2 s.  c o m*/
 *
 * @param is the System.in input stream to copy from
 * @param os the output stream to copy into
 * @return the stream pumper thread
 */
private Thread createSystemInPump(InputStream is, OutputStream os) {
    inputStreamPumper = new InputStreamPumper(is, os);
    final Thread result = new Thread(inputStreamPumper);
    result.setDaemon(true);
    return result;
}

From source file:maker.task.compile.ReplTestPumpStreamHandler.java

/**
 * Creates a stream pumper to copy the given input stream to the given
 * output stream./*w w  w . j a v  a2  s.  c  o m*/
 *
 * @param is the System.in input stream to copy from
 * @param os the output stream to copy into
 * @return the stream pumper thread
 */
private Thread createSystemInPump(final InputStream is, final OutputStream os) {
    inputStreamPumper = new InputStreamPumper(is, os);
    final Thread result = new Thread(inputStreamPumper, "Exec Input Stream Pumper");
    result.setDaemon(true);
    return result;
}