Class OkHttpResponseBody

java.lang.Object
ru.tinkoff.kora.http.client.ok.OkHttpResponseBody
All Implemented Interfaces:
Closeable, AutoCloseable, Flow.Publisher<ByteBuffer>, ru.tinkoff.kora.http.common.body.HttpBody, ru.tinkoff.kora.http.common.body.HttpBodyInput

public final class OkHttpResponseBody extends Object implements ru.tinkoff.kora.http.common.body.HttpBodyInput
  • Constructor Details

    • OkHttpResponseBody

      public OkHttpResponseBody(okhttp3.ResponseBody body)
  • Method Details

    • contentLength

      public long contentLength()
      Specified by:
      contentLength in interface ru.tinkoff.kora.http.common.body.HttpBody
    • contentType

      @Nullable public String contentType()
      Specified by:
      contentType in interface ru.tinkoff.kora.http.common.body.HttpBody
    • subscribe

      public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber)
      Specified by:
      subscribe in interface Flow.Publisher<ByteBuffer>
      Specified by:
      subscribe in interface ru.tinkoff.kora.http.common.body.HttpBodyInput
    • asInputStream

      public InputStream asInputStream()
      Specified by:
      asInputStream in interface ru.tinkoff.kora.http.common.body.HttpBodyInput
    • asBufferStage

      public CompletionStage<ByteBuffer> asBufferStage()
      Specified by:
      asBufferStage in interface ru.tinkoff.kora.http.common.body.HttpBodyInput
    • asArrayStage

      public CompletionStage<byte[]> asArrayStage()
      Specified by:
      asArrayStage in interface ru.tinkoff.kora.http.common.body.HttpBodyInput
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException