net.sf.asyncobjects.io.util
Class UncloseableInput<D extends BatchedData<D>,I extends AInput<D>>
java.lang.Object
net.sf.asyncobjects.AsyncUnicastServer<FacetType>
net.sf.asyncobjects.util.CloseableWrapper<I,I>
net.sf.asyncobjects.io.util.UncloseableInput<D,I>
- Type Parameters:
D
- a batched data typeI
- an input type
- All Implemented Interfaces:
- ACloseable, AsyncObject, ExplicitSharing, AInput<D>
- Direct Known Subclasses:
- UncloseableByteInput, UncloseableTextInput
public class UncloseableInput<D extends BatchedData<D>,I extends AInput<D>>
- extends CloseableWrapper<I,I>
- implements AInput<D>
A stream that instead of closing underlying stream just resolves
CloseableWrapper.closed()
promise.
- Author:
- const
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UncloseableInput
public UncloseableInput(I stream)
- A constructor
- Parameters:
stream
- an underlying stream
read
public Promise<D> read(int limit)
- Description copied from interface:
AInput
- Read some data.
- Specified by:
read
in interface AInput<D extends BatchedData<D>>
- Parameters:
limit
- a maximum amount of data elements to read.
- Returns:
- Promise for non-empty data batch that contains read inforation or
null if eof is reached.
- See Also:
AInput.read(int)
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()
pushback
public Promise<Void> pushback(D data)
- Pushback
- Specified by:
pushback
in interface AInput<D extends BatchedData<D>>
- Parameters:
data
- a data to push back
- Returns:
- when pushback finishes
- See Also:
AInput.pushback(net.sf.asyncobjects.io.BatchedData)
Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.