Class AsyncStreamHelper


  • Deprecated. 
    Prefer the Reactive Streams-based asynchronous driver (mongodb-driver-reactivestreams artifactId)

    @Deprecated
    public final class AsyncStreamHelper
    extends java.lang.Object
    A general helper class that creates AsyncInputStream or AsyncOutputStream instances. Provides support for:
    • byte[] - Converts byte arrays into Async Streams
    • ByteBuffer - Converts ByteBuffers into Async Streams
    • InputStream - Converts InputStreams into Async Streams (Note: InputStream implementations are blocking)
    • OutputStream - Converts OutputStreams into Async Streams (Note: OutputStream implementations are blocking)
    Since:
    3.3
    • Method Detail

      • toAsyncInputStream

        public static AsyncInputStream toAsyncInputStream​(byte[] srcBytes)
        Deprecated. 
        Converts a byte[] into a AsyncInputStream
        Parameters:
        srcBytes - the data source
        Returns:
        the AsyncInputStream
      • toAsyncOutputStream

        public static AsyncOutputStream toAsyncOutputStream​(byte[] dstBytes)
        Deprecated. 
        Converts a byte[] into a AsyncOutputStream
        Parameters:
        dstBytes - the data destination
        Returns:
        the AsyncOutputStream
      • toAsyncInputStream

        public static AsyncInputStream toAsyncInputStream​(java.nio.ByteBuffer srcByteBuffer)
        Deprecated. 
        Converts a ByteBuffer into a AsyncInputStream
        Parameters:
        srcByteBuffer - the data source
        Returns:
        the AsyncInputStream
      • toAsyncOutputStream

        public static AsyncOutputStream toAsyncOutputStream​(java.nio.ByteBuffer dstByteBuffer)
        Deprecated. 
        Converts a ByteBuffer into a AsyncOutputStream
        Parameters:
        dstByteBuffer - the data destination
        Returns:
        the AsyncOutputStream
      • toAsyncInputStream

        public static AsyncInputStream toAsyncInputStream​(java.io.InputStream inputStream)
        Deprecated. 
        Converts a InputStream into a AsyncInputStream
        Parameters:
        inputStream - the InputStream
        Returns:
        the AsyncInputStream
      • toAsyncOutputStream

        public static AsyncOutputStream toAsyncOutputStream​(java.io.OutputStream outputStream)
        Deprecated. 
        Converts a OutputStream into a AsyncOutputStream
        Parameters:
        outputStream - the OutputStream
        Returns:
        the AsyncOutputStream