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

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

Introduction

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

Prototype

public StreamPumper(final InputStream is, final OutputStream os, final boolean closeWhenExhausted) 

Source Link

Document

Create a new stream pumper.

Usage

From source file:com.adaptris.hpcc.ManagedPumpStreamHandler.java

protected Thread createPump(final InputStream is, final OutputStream os, final boolean closeWhenExhausted) {
    String name = Thread.currentThread().getName();
    final Thread result = MTF.newThread(new StreamPumper(is, os, closeWhenExhausted));
    result.setName(name);//from ww  w  .j a v a 2 s. c o  m
    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./*from w ww .  ja  va 2 s .c o m*/
 *
 * @param is                 the input stream to copy from
 * @param os                 the output stream to copy into
 * @param closeWhenExhausted close the output stream when the input stream is exhausted
 * @return the stream pumper thread
 */
protected Thread createPump(final InputStream is, final OutputStream os, final boolean closeWhenExhausted) {
    final Thread result = new Thread(new StreamPumper(is, os, closeWhenExhausted), "Exec Stream Pumper");
    result.setDaemon(true);
    return result;
}