Class ByteBufferBodyAdapter

All Implemented Interfaces:
BufferConsumer.Upstream, org.reactivestreams.Subscriber<ByteBuffer>

public final class ByteBufferBodyAdapter extends AbstractBodyAdapter<ByteBuffer,ReactiveByteBufferByteBody.SharedBuffer>
Adapter from Publisher of NIO ByteBuffer to a ReactiveByteBufferByteBody.
Since:
4.8.0
  • Method Details

    • adapt

      public static CloseableByteBody adapt(@NonNull @NonNull org.reactivestreams.Publisher<ByteBuffer> publisher, @NonNull @NonNull OptionalLong contentLength)
      Create a new body from the given publisher.
      Parameters:
      publisher - The input publisher
      contentLength - Optional length of the body, must match the publisher exactly
      Returns:
      The ByteBody fed by the publisher
    • onNext

      public void onNext(ByteBuffer buffer)