Class PublisherBytesSupplier

    • Method Detail

      • appendContent

        public void appendContent​(byte[] data,
                                  boolean lastChunk)
        Appends content to the BytesSupplier.
        Parameters:
        data - bytes to append
        lastChunk - true if this is the last chunk
      • subscribe

        public java.util.concurrent.CompletableFuture<java.lang.Void> subscribe​(java.util.function.Consumer<byte[]> subscriber)
        Adds the subscriber to the BytesSupplier to get notified about additional data.
        Parameters:
        subscriber - a consumer function that will receive bytes when new daata is added and null when completed
        Returns:
        a CompletableFuture object
      • toByteBuffer

        public java.nio.ByteBuffer toByteBuffer()
        Returns the ByteBuffer presentation of the object.
        Specified by:
        toByteBuffer in interface BytesSupplier
        Returns:
        the ByteBuffer presentation of the object