Package com.mongodb.internal.connection
Class AsynchronousChannelStream
java.lang.Object
com.mongodb.internal.connection.AsynchronousChannelStream
- All Implemented Interfaces:
BufferProvider
,Stream
- Direct Known Subclasses:
AsynchronousSocketChannelStream
@Deprecated(since="2021-05-27")
public abstract class AsynchronousChannelStream
extends Object
implements Stream
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
Not part of the public API.
-
Constructor Summary
ConstructorsConstructorDescriptionAsynchronousChannelStream
(ServerAddress serverAddress, SocketSettings settings, BufferProvider bufferProvider) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.Closes the connection.Deprecated.The address that this stream is connected to.getBuffer
(int size) Deprecated.Gets a buffer with the givens capacity.Deprecated.Deprecated.Deprecated.Deprecated.boolean
isClosed()
Deprecated.Returns the closed state of the connectionvoid
open()
Deprecated.Open the stream.read
(int numBytes) Deprecated.Read from the stream, blocking until the requested number of bytes have been read.void
readAsync
(int numBytes, AsyncCompletionHandler<ByteBuf> handler) Deprecated.Read from the stream, asynchronously.void
Deprecated.Write each buffer in the list to the stream in order, blocking until all are completely written.void
writeAsync
(List<ByteBuf> buffers, AsyncCompletionHandler<Void> handler) Deprecated.Write each buffer in the list to the stream in order, asynchronously.
-
Constructor Details
-
AsynchronousChannelStream
public AsynchronousChannelStream(ServerAddress serverAddress, SocketSettings settings, BufferProvider bufferProvider) Deprecated.
-
-
Method Details
-
getServerAddress
Deprecated. -
getSettings
Deprecated. -
getBufferProvider
Deprecated. -
getChannel
Deprecated. -
writeAsync
Deprecated.Description copied from interface:Stream
Write each buffer in the list to the stream in order, asynchronously. This method should return immediately, and invoke the given callback on completion.- Specified by:
writeAsync
in interfaceStream
- Parameters:
buffers
- the buffers to writehandler
- invoked when the read operation has completed
-
readAsync
Deprecated.Description copied from interface:Stream
Read from the stream, asynchronously. This method should return immediately, and invoke the given callback when the number of requested bytes have been read. -
open
Deprecated.Description copied from interface:Stream
Open the stream.- Specified by:
open
in interfaceStream
- Throws:
IOException
- if an I/O error occurs
-
write
Deprecated.Description copied from interface:Stream
Write each buffer in the list to the stream in order, blocking until all are completely written.- Specified by:
write
in interfaceStream
- Parameters:
buffers
- the buffers to write- Throws:
IOException
- if there are problems writing to the stream
-
read
Deprecated.Description copied from interface:Stream
Read from the stream, blocking until the requested number of bytes have been read.- Specified by:
read
in interfaceStream
- Parameters:
numBytes
- The number of bytes to read into the returned byte buffer- Returns:
- a byte buffer filled with number of bytes requested
- Throws:
IOException
- if there are problems reading from the stream
-
getAddress
Deprecated.Description copied from interface:Stream
The address that this stream is connected to.- Specified by:
getAddress
in interfaceStream
- Returns:
- the address
-
close
public void close()Deprecated.Description copied from interface:Stream
Closes the connection. -
isClosed
public boolean isClosed()Deprecated.Description copied from interface:Stream
Returns the closed state of the connection -
getBuffer
Deprecated.Description copied from interface:BufferProvider
Gets a buffer with the givens capacity.- Specified by:
getBuffer
in interfaceBufferProvider
- Parameters:
size
- the size required for the buffer- Returns:
- a ByteBuf with the given size, which is now owned by the caller and must be released.
-