com.sun.grizzly
Interface Readable<L>

All Superinterfaces:
Closeable
All Known Subinterfaces:
Connection<L>, NIOConnection
All Known Implementing Classes:
AbstractNIOConnection, TCPNIOConnection, TCPNIOServerConnection, UDPNIOConnection, UDPNIOServerConnection

public interface Readable<L>
extends Closeable

Implementatios of this interface are able to read data from internal source to a Buffer. Grizzly Connection extends Readable.

Author:
Alexey Stashok

Method Summary
 Future<ReadResult<Buffer,L>> read()
          Method reads data.
 Future<ReadResult<Buffer,L>> read(Buffer buffer)
          Method reads data to the buffer.
 Future<ReadResult<Buffer,L>> read(Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler)
          Method reads data to the buffer.
 Future<ReadResult<Buffer,L>> read(Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler, Condition<ReadResult<Buffer,L>> condition)
          Method reads data to the buffer.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

read

Future<ReadResult<Buffer,L>> read()
                                  throws IOException
Method reads data.

Returns:
Future, using which it's possible to check the result
Throws:
IOException

read

Future<ReadResult<Buffer,L>> read(Buffer buffer)
                                  throws IOException
Method reads data to the buffer.

Parameters:
buffer - the buffer, where data will be read
Returns:
Future, using which it's possible to check the result
Throws:
IOException

read

Future<ReadResult<Buffer,L>> read(Buffer buffer,
                                  CompletionHandler<ReadResult<Buffer,L>> completionHandler)
                                  throws IOException
Method reads data to the buffer.

Parameters:
buffer - the buffer, where data will be read
completionHandler - CompletionHandler, which will get notified, when read will be completed
Returns:
Future, using which it's possible to check the result
Throws:
IOException

read

Future<ReadResult<Buffer,L>> read(Buffer buffer,
                                  CompletionHandler<ReadResult<Buffer,L>> completionHandler,
                                  Condition<ReadResult<Buffer,L>> condition)
                                  throws IOException
Method reads data to the buffer.

Parameters:
buffer - the buffer, where data will be read
completionHandler - CompletionHandler, which will get notified, when read will be completed
condition - Condition, which will be checked each time new portion of a data was read to a buffer. The condition can decide, whether asynchronous read is completed or not.
Returns:
Future, using which it's possible to check the result
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.