public abstract class AsynchronousChannelStream extends java.lang.Object implements Stream
Constructor and Description |
---|
AsynchronousChannelStream(ServerAddress serverAddress,
SocketSettings settings,
BufferProvider bufferProvider) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection.
|
ServerAddress |
getAddress()
The address that this stream is connected to.
|
ByteBuf |
getBuffer(int size)
Gets a buffer with the givens capacity.
|
BufferProvider |
getBufferProvider() |
ExtendedAsynchronousByteChannel |
getChannel() |
ServerAddress |
getServerAddress() |
SocketSettings |
getSettings() |
boolean |
isClosed()
Returns the closed state of the connection
|
void |
open()
Open the stream.
|
ByteBuf |
read(int numBytes)
Read from the stream, blocking until the requested number of bytes have been read.
|
void |
readAsync(int numBytes,
AsyncCompletionHandler<ByteBuf> handler)
Read from the stream, asynchronously.
|
void |
write(java.util.List<ByteBuf> buffers)
Write each buffer in the list to the stream in order, blocking until all are completely written.
|
void |
writeAsync(java.util.List<ByteBuf> buffers,
AsyncCompletionHandler<java.lang.Void> handler)
Write each buffer in the list to the stream in order, asynchronously.
|
public AsynchronousChannelStream(ServerAddress serverAddress, SocketSettings settings, BufferProvider bufferProvider)
public ServerAddress getServerAddress()
public SocketSettings getSettings()
public BufferProvider getBufferProvider()
public ExtendedAsynchronousByteChannel getChannel()
public void writeAsync(java.util.List<ByteBuf> buffers, AsyncCompletionHandler<java.lang.Void> handler)
Stream
writeAsync
in interface Stream
buffers
- the buffers to writehandler
- invoked when the read operation has completedpublic void readAsync(int numBytes, AsyncCompletionHandler<ByteBuf> handler)
Stream
public void open() throws java.io.IOException
Stream
public void write(java.util.List<ByteBuf> buffers) throws java.io.IOException
Stream
public ByteBuf read(int numBytes) throws java.io.IOException
Stream
public ServerAddress getAddress()
Stream
getAddress
in interface Stream
public void close()
Stream
public boolean isClosed()
Stream
public ByteBuf getBuffer(int size)
BufferProvider
getBuffer
in interface BufferProvider
size
- the size required for the bufferCopyright © 2010 - 2023 Adobe. All Rights Reserved