Class ByteChannelBodySubscriber

java.lang.Object
com.github.mizosoft.methanol.internal.extensions.ByteChannelBodySubscriber
All Implemented Interfaces:
HttpResponse.BodySubscriber<ReadableByteChannel>, Flow.Subscriber<List<ByteBuffer>>

public final class ByteChannelBodySubscriber extends Object implements HttpResponse.BodySubscriber<ReadableByteChannel>
A subscriber that exposes the flow of bytes as a ReadableByteChannel. The channel is InterruptibleChannel and either closing it asynchronously or interrupting the reader thread causes blocks on read() to throw the appropriate exception and the upstream to be cancelled. Any errors received from upstream are immediately thrown when reading if detected, even if some bytes were available.