com.sun.grizzly
Interface Writable<L>

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

public interface Writable<L>
extends Closeable

Implementatios of this interface are able to write data from a Buffer. Grizzly Connection extends Writable.

Author:
Alexey Stashok

Method Summary
 Future<WriteResult<Buffer,L>> write(Buffer buffer)
          Method writes the buffer.
 Future<WriteResult<Buffer,L>> write(Buffer buffer, CompletionHandler<WriteResult<Buffer,L>> completionHandler)
          Method writes the buffer.
 Future<WriteResult<Buffer,L>> write(L dstAddress, Buffer buffer)
          Method writes the buffer to the specific address.
 Future<WriteResult<Buffer,L>> write(L dstAddress, Buffer buffer, CompletionHandler<WriteResult<Buffer,L>> completionHandler)
          Method writes the buffer to the specific address.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

write

Future<WriteResult<Buffer,L>> write(Buffer buffer)
                                    throws IOException
Method writes the buffer.

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

write

Future<WriteResult<Buffer,L>> write(Buffer buffer,
                                    CompletionHandler<WriteResult<Buffer,L>> completionHandler)
                                    throws IOException
Method writes the buffer.

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

write

Future<WriteResult<Buffer,L>> write(L dstAddress,
                                    Buffer buffer)
                                    throws IOException
Method writes the buffer to the specific address.

Parameters:
dstAddress - the destination address the buffer will be sent to
buffer - the buffer, from which the data will be written
Returns:
Future, using which it's possible to check the result
Throws:
IOException

write

Future<WriteResult<Buffer,L>> write(L dstAddress,
                                    Buffer buffer,
                                    CompletionHandler<WriteResult<Buffer,L>> completionHandler)
                                    throws IOException
Method writes the buffer to the specific address.

Parameters:
dstAddress - the destination address the buffer will be sent to
buffer - the buffer, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed
Returns:
Future, using which it's possible to check the result
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.