net.sf.asyncobjects.io
Class ByteStreamForwarder

java.lang.Object
  extended by net.sf.asyncobjects.io.ByteStreamForwarder

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

@Deprecated
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.

Author:
const

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

ByteStreamForwarder

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

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

start

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

Returns:
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.