net.sf.asyncobjects.io
Class Pipe.InternalPipeInput

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<I>
      extended by net.sf.asyncobjects.io.Pipe.InternalPipeInput
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AInput<D>
Direct Known Subclasses:
BytePipe.InternalBytePipeInput, TextPipe.InternalTextPipeInput
Enclosing class:
Pipe<D extends BatchedData<D>,I extends AInput<D>,O extends AOutput<D>,C extends AChannel<D,I,O>>

public class Pipe.InternalPipeInput
extends AsyncUnicastServer<I>
implements AInput<D>

This is an internal class. Input of the pipe. This class supports AByteInput interface.


Constructor Summary
protected Pipe.InternalPipeInput()
          a private constructor
 
Method Summary
 Promise<Void> close()
          close stream
 Promise<Boolean> isPushbackSupported()
           
 Promise<Void> pushback(D pushbackData)
          Push data back to the stream
 Promise<D> read(int limit)
          read some bytes
 
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer
dereference, export, isImmediate, myVat, promise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.asyncobjects.AsyncObject
dereference, isImmediate
 

Constructor Detail

Pipe.InternalPipeInput

protected Pipe.InternalPipeInput()
a private constructor

Method Detail

read

public Promise<D> read(int limit)
read some bytes

Specified by:
read in interface AInput<D extends BatchedData<D>>
Parameters:
limit - a maximum amount of data expected by client.
Returns:
Promise for read data or null (if eof)
See Also:
AInput.read(int)

pushback

public Promise<Void> pushback(D pushbackData)
Push data back to the stream

Specified by:
pushback in interface AInput<D extends BatchedData<D>>
Parameters:
pushbackData - a data that is being pushed back
Returns:
a promise that resolves to null or breaks with exception.
See Also:
AInput.pushback(BatchedData)

close

public Promise<Void> close()
close stream

Specified by:
close in interface ACloseable
Returns:
a promise that resolves to null or breaks with exception.
See Also:
ACloseable.close()

isPushbackSupported

public Promise<Boolean> isPushbackSupported()
Specified by:
isPushbackSupported in interface AInput<D extends BatchedData<D>>
Returns:
true if pushback supported for this stream
See Also:
AInput.isPushbackSupported()


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.