|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.AsyncUnicastServer<I> net.sf.asyncobjects.io.BufferedInput<D,I>
D
- a batched data typeI
- an input typepublic class BufferedInput<D extends BatchedData<D>,I extends AInput<D>>
A buffered input stream. Note that it reads at most toReadLimit
bytes from underlying stream even if client asked for more.
The stream also supports prefetch mode (enabled by default). In this mode, when the buffer dries out, the stream initate a read request to the underlying stream. Therefore it is possible that buffer will replenish while client processes the data.
Constructor Summary | |
---|---|
BufferedInput(I proxiedStream,
int limit)
A constructor from the stream |
|
BufferedInput(I proxiedStream,
int limit,
boolean prefetch)
A constructor from the stream |
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 in buffer |
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 |
---|
public BufferedInput(I proxiedStream, int limit, boolean prefetch)
proxiedStream
- a stream that is being proxiedlimit
- a maximum amount of bites to be attempte to read from
undelying streamprefetch
- if true the data is fetched when it is all read out before the
next read operation false if data is fetched only during read
requests.public BufferedInput(I proxiedStream, int limit)
proxiedStream
- a stream that is being proxiedlimit
- a maximum amount of bites to be attempte to read from
undelying streamMethod Detail |
---|
public Promise<D> read(int limit)
read
in interface AInput<D extends BatchedData<D>>
limit
- maximum amount of bytes that will be read by this operation
AInput.read(int)
public Promise<Void> pushback(D pushbackData)
pushback
in interface AInput<D extends BatchedData<D>>
pushbackData
- a data that is being pushed back
AInput.pushback(BatchedData)
public Promise<Void> close()
close
in interface ACloseable
public Promise<Boolean> isPushbackSupported()
isPushbackSupported
in interface AInput<D extends BatchedData<D>>
AInput.isPushbackSupported()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |