Class HttpStream

  • All Implemented Interfaces:
    AutoCloseable

    public class HttpStream
    extends HttpStreamBase
    An HttpStream represents a single HTTP/1.1 specific Http Request/Response.
    • Method Detail

      • writeChunk

        public void writeChunk​(byte[] chunkData,
                               boolean isFinalChunk,
                               HttpStream.HttpStreamWriteChunkCompletionCallback chunkCompletionCallback)
        Use only for Http 1.1 Chunked Encoding. You must call activate() before using this function.
        Parameters:
        chunkData - chunk of data to send.
        isFinalChunk - if set to true, this will terminate the request stream.
        chunkCompletionCallback - Invoked upon the data being flushed to the wire or an error occurring.
      • writeChunk

        public CompletableFuture<Void> writeChunk​(byte[] chunkData,
                                                  boolean isFinalChunk)
        Use only for Http 1.1 Chunked Encoding. You must call activate() before using this function.
        Parameters:
        chunkData - chunk of data to send.
        isFinalChunk - if set to true, this will terminate the request stream.
        Returns:
        completable future which will complete upon the data being flushed to the wire or an error occurring.