Class AsynchronousChannelStream

  • All Implemented Interfaces:
    BufferProvider, Stream
    Direct Known Subclasses:
    AsynchronousSocketChannelStream

    @Deprecated(since="2021-05-27")
    public abstract class AsynchronousChannelStream
    extends java.lang.Object
    implements Stream
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    Not part of the public API.
    • Method Detail

      • getServerAddress

        public ServerAddress getServerAddress()
        Deprecated.
      • getBufferProvider

        public BufferProvider getBufferProvider()
        Deprecated.
      • writeAsync

        public void writeAsync​(java.util.List<ByteBuf> buffers,
                               AsyncCompletionHandler<java.lang.Void> handler)
        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 interface Stream
        Parameters:
        buffers - the buffers to write
        handler - invoked when the read operation has completed
      • readAsync

        public void readAsync​(int numBytes,
                              AsyncCompletionHandler<ByteBuf> handler)
        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.
        Specified by:
        readAsync in interface Stream
        Parameters:
        numBytes - the number of bytes
        handler - invoked when the read operation has completed
      • open

        public void open()
                  throws java.io.IOException
        Deprecated.
        Description copied from interface: Stream
        Open the stream.
        Specified by:
        open in interface Stream
        Throws:
        java.io.IOException - if an I/O error occurs
      • write

        public void write​(java.util.List<ByteBuf> buffers)
                   throws java.io.IOException
        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 interface Stream
        Parameters:
        buffers - the buffers to write
        Throws:
        java.io.IOException - if there are problems writing to the stream
      • read

        public ByteBuf read​(int numBytes)
                     throws java.io.IOException
        Deprecated.
        Description copied from interface: Stream
        Read from the stream, blocking until the requested number of bytes have been read.
        Specified by:
        read in interface Stream
        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
      • getAddress

        public ServerAddress getAddress()
        Deprecated.
        Description copied from interface: Stream
        The address that this stream is connected to.
        Specified by:
        getAddress in interface Stream
        Returns:
        the address
      • close

        public void close()
        Deprecated.
        Description copied from interface: Stream
        Closes the connection.
        Specified by:
        close in interface Stream
      • isClosed

        public boolean isClosed()
        Deprecated.
        Description copied from interface: Stream
        Returns the closed state of the connection
        Specified by:
        isClosed in interface Stream
        Returns:
        true if connection is closed
      • getBuffer

        public ByteBuf getBuffer​(int size)
        Deprecated.
        Description copied from interface: BufferProvider
        Gets a buffer with the givens capacity.
        Specified by:
        getBuffer in interface BufferProvider
        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.