Class AsyncOutputStream

java.lang.Object
java.io.OutputStream
org.jboss.resteasy.spi.AsyncOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Direct Known Subclasses:
BlockingAsyncOutputStream, ChunkOutputStream, ChunkOutputStream, CommitHeaderAsyncOutputStream, HeaderFlushedAsyncOutputStream, HttpServletResponseWrapper.DeferredOutputStream

public abstract class AsyncOutputStream extends OutputStream
OutputStream which supports async IO operations. Use these operations if you need to support async IO.
  • Constructor Details

    • AsyncOutputStream

      public AsyncOutputStream()
  • Method Details

    • asyncFlush

      public abstract CompletionStage<Void> asyncFlush()
      Flushes this async output stream.
      Returns:
      a CompletionStage notified on completion of the flush operation.
    • asyncWrite

      public CompletionStage<Void> asyncWrite(byte[] bytes)
      Writes to this async output stream. Equivalent to asyncWrite(bytes, 0, bytes.length.
      Parameters:
      bytes - the bytes to write
      Returns:
      a CompletionStage notified on completion of the write operation.
    • asyncWrite

      public abstract CompletionStage<Void> asyncWrite(byte[] bytes, int offset, int length)
      Writes to this async output stream.
      Parameters:
      bytes - the bytes to write
      offset - the offset from which to start writing in the given byte array.
      length - the number of bytes to write from the given byte array
      Returns:
      a CompletionStage notified on completion of the write operation.