Package com.mongodb.connection
Interface Stream
-
- All Superinterfaces:
BufferProvider
- All Known Implementing Classes:
AsynchronousChannelStream
,AsynchronousSocketChannelStream
,SocketStream
,UnixSocketChannelStream
@Deprecated(since="2021-05-27") public interface Stream extends BufferProvider
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.A full duplex stream of bytes.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.Closes the connection.ServerAddress
getAddress()
Deprecated.The address that this stream is connected to.boolean
isClosed()
Deprecated.Returns the closed state of the connectionvoid
open()
Deprecated.Open the stream.void
openAsync(AsyncCompletionHandler<java.lang.Void> handler)
Deprecated.Open the stream asynchronously.ByteBuf
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
write(java.util.List<ByteBuf> buffers)
Deprecated.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)
Deprecated.Write each buffer in the list to the stream in order, asynchronously.-
Methods inherited from interface com.mongodb.connection.BufferProvider
getBuffer
-
-
-
-
Method Detail
-
open
void open() throws java.io.IOException
Deprecated.Open the stream.- Throws:
java.io.IOException
- if an I/O error occurs
-
openAsync
void openAsync(AsyncCompletionHandler<java.lang.Void> handler)
Deprecated.Open the stream asynchronously.- Parameters:
handler
- the completion handler for opening the stream
-
write
void write(java.util.List<ByteBuf> buffers) throws java.io.IOException
Deprecated.Write each buffer in the list to the stream in order, blocking until all are completely written.- Parameters:
buffers
- the buffers to write- Throws:
java.io.IOException
- if there are problems writing to the stream
-
read
ByteBuf read(int numBytes) throws java.io.IOException
Deprecated.Read from the stream, blocking until the requested number of bytes have been read.- Parameters:
numBytes
- The number of bytes to read into the returned byte buffer- Returns:
- a byte buffer filled with number of bytes requested
- Throws:
java.io.IOException
- if there are problems reading from the stream
-
writeAsync
void writeAsync(java.util.List<ByteBuf> buffers, AsyncCompletionHandler<java.lang.Void> handler)
Deprecated.Write each buffer in the list to the stream in order, asynchronously. This method should return immediately, and invoke the given callback on completion.- Parameters:
buffers
- the buffers to writehandler
- invoked when the read operation has completed
-
readAsync
void readAsync(int numBytes, AsyncCompletionHandler<ByteBuf> handler)
Deprecated.Read from the stream, asynchronously. This method should return immediately, and invoke the given callback when the number of requested bytes have been read.- Parameters:
numBytes
- the number of byteshandler
- invoked when the read operation has completed
-
getAddress
ServerAddress getAddress()
Deprecated.The address that this stream is connected to.- Returns:
- the address
-
close
void close()
Deprecated.Closes the connection.
-
isClosed
boolean isClosed()
Deprecated.Returns the closed state of the connection- Returns:
- true if connection is closed
-
-