|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NIOInputSource
This interface defines methods to allow an InputStream or
Reader to notify the developer when and how much
data is ready to be read without blocking.
| Method Summary | |
|---|---|
Buffer |
getBuffer()
Returns the underlying Buffer that backs this
NIOInputSource. |
boolean |
isFinished()
|
boolean |
isReady()
|
boolean |
notifyAvailable(ReadHandler handler)
Notify the specified ReadHandler when any number of bytes
can be read without blocking. |
boolean |
notifyAvailable(ReadHandler handler,
int size)
Notify the specified ReadHandler when the number of bytes that
can be read without blocking is greater or equal to the specified
size. |
int |
readyData()
|
| Method Detail |
|---|
boolean notifyAvailable(ReadHandler handler)
Notify the specified ReadHandler when any number of bytes
can be read without blocking.
Invoking this method is equivalent to calling: notifyAvailable(handler, 0).
handler - the ReadHandler to notify.
true if the specified handler has
been accepted and will be notified as data becomes available to write,
otherwise returns false which means data is available to
be read without blocking.- See Also:
ReadHandler.onDataAvailable(),
ReadHandler.onAllDataRead()
boolean notifyAvailable(ReadHandler handler,
int size)
Notify the specified ReadHandler when the number of bytes that
can be read without blocking is greater or equal to the specified
size.
handler - the ReadHandler to notify.size - the least number of bytes that must be available before
the ReadHandler is invoked. If size is 0, the
handler will be notified as soon as data is available no matter the
size.
true if the specified handler has
been accepted and will be notified as data becomes available to write,
otherwise returns false which means data is available to
be read without blocking.- See Also:
ReadHandler.onDataAvailable(),
ReadHandler.onAllDataRead()boolean isFinished()
true when all data for this particular request
has been read, otherwise returns false.int readyData()
boolean isReady()
true if data can be obtained without blocking,
otherwise returns false.Buffer getBuffer()
Returns the underlying Buffer that backs this
NIOInputSource.
It should be noted that for character-based NIOInputSources,
the Buffer is the raw bytes. Any character conversion
would have to be applied manually.
Buffer that backs this
NIOInputSource.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||