Class ByteStreamForwarder

  extended by

Deprecated. IOUtils.forward(AInput, AOutput, long, int)

public class ByteStreamForwarder
extends Object

This component just reads data from one stream and writes it to another. This class is too expensive to provide it in non asynchronous envronment as it requires thread in synchronous case, but for asynchronous API, it is very cheap.


Constructor Summary
ByteStreamForwarder(AByteInput in, AByteOutput out, int bufferSize, boolean autoFlush)
          Deprecated. a consturtor
Method Summary
 Promise<Void> start()
          Deprecated. start reading from one stream and writing to another.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ByteStreamForwarder(AByteInput in,
                           AByteOutput out,
                           int bufferSize,
                           boolean autoFlush)
a consturtor

in - input stream
out - output stream
bufferSize - buffer size
autoFlush - if true output will be flushed after each write
Method Detail


public Promise<Void> start()
start reading from one stream and writing to another. Note that CoPipe never flushed output stream and also does not close them.

Promise that resolves to null if stream is read until end of stream or problem if there are problems with readin or writing.

Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.