Class ByteBufferAsyncRequestBody

java.lang.Object
io.trino.plugin.exchange.filesystem.s3.ByteBufferAsyncRequestBody
All Implemented Interfaces:
org.reactivestreams.Publisher<ByteBuffer>, software.amazon.awssdk.core.async.AsyncRequestBody, software.amazon.awssdk.core.async.SdkPublisher<ByteBuffer>

public final class ByteBufferAsyncRequestBody extends Object implements software.amazon.awssdk.core.async.AsyncRequestBody
This class mimics the implementation of ByteArrayAsyncRequestBody except for we use a ByteBuffer to avoid unnecessary memory copy An implementation of AsyncRequestBody for providing data from memory. This is created using static methods on AsyncRequestBody
See Also:
  • AsyncRequestBody.fromBytes(byte[])
  • AsyncRequestBody.fromByteBuffer(ByteBuffer)
  • AsyncRequestBody.fromString(String)
  • Constructor Details

    • ByteBufferAsyncRequestBody

      public ByteBufferAsyncRequestBody(ByteBuffer byteBuffer, String mimetype)
  • Method Details

    • contentLength

      public Optional<Long> contentLength()
      Specified by:
      contentLength in interface software.amazon.awssdk.core.async.AsyncRequestBody
    • contentType

      public String contentType()
      Specified by:
      contentType in interface software.amazon.awssdk.core.async.AsyncRequestBody
    • subscribe

      public void subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
      Specified by:
      subscribe in interface org.reactivestreams.Publisher<ByteBuffer>