L
- the reader address typepublic interface Reader<L>
Connection
to a Buffer
.
There are two basic Reader implementations in Grizzly:
AsyncQueueReader
,
TemporarySelectorReader
.Modifier and Type | Field and Description |
---|---|
static int |
COMPLETE_EVENT |
static int |
INCOMPLETE_EVENT |
static int |
READ_EVENT |
Modifier and Type | Method and Description |
---|---|
GrizzlyFuture<ReadResult<Buffer,L>> |
read(Connection<L> connection)
Method reads data.
|
GrizzlyFuture<ReadResult<Buffer,L>> |
read(Connection<L> connection,
Buffer buffer)
Method reads data to the buffer.
|
void |
read(Connection<L> connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,L>> completionHandler)
Method reads data to the buffer.
|
void |
read(Connection<L> connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,L>> completionHandler,
Interceptor<ReadResult> interceptor)
Method reads data to the buffer.
|
static final int READ_EVENT
static final int COMPLETE_EVENT
static final int INCOMPLETE_EVENT
GrizzlyFuture<ReadResult<Buffer,L>> read(Connection<L> connection)
connection
- the Connection
to read fromFuture
, using which it's possible to check the resultGrizzlyFuture<ReadResult<Buffer,L>> read(Connection<L> connection, Buffer buffer)
connection
- the Connection
to read frombuffer
- the buffer, where data will be readFuture
, using which it's possible to check the resultvoid read(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler)
connection
- the Connection
to read frombuffer
- the buffer, where data will be readcompletionHandler
- CompletionHandler
,
which will get notified, when read will be completedvoid read(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler, Interceptor<ReadResult> interceptor)
connection
- the Connection
to read frombuffer
- the Buffer
to which data will be readcompletionHandler
- CompletionHandler
,
which will get notified, when read will be completedinterceptor
- Interceptor
, which will be able to intercept
control each time new portion of a data was read to a
buffer.
The interceptor can decide, whether asynchronous read is
completed or not, or provide other processing instructions.Copyright © 2015 Oracle Corporation. All rights reserved.