Class ReactiveEntityProducer
java.lang.Object
org.apache.hc.core5.reactive.ReactiveEntityProducer
- All Implemented Interfaces:
org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.nio.AsyncDataProducer, org.apache.hc.core5.http.nio.AsyncEntityProducer, org.apache.hc.core5.http.nio.ResourceHolder
@Contract(threading=SAFE)
public final class ReactiveEntityProducer
extends Object
implements org.apache.hc.core5.http.nio.AsyncEntityProducer
An
AsyncEntityProducer that subscribes to a Publisher
instance, as defined by the Reactive Streams specification.- Since:
- 5.0
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveEntityProducer(org.reactivestreams.Publisher<ByteBuffer> publisher, long contentLength, org.apache.hc.core5.http.ContentType contentType, String contentEncoding) Creates a newReactiveEntityProducerwith the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionintvoidlongbooleanbooleanvoidproduce(org.apache.hc.core5.http.nio.DataStreamChannel channel) void
-
Constructor Details
-
ReactiveEntityProducer
public ReactiveEntityProducer(org.reactivestreams.Publisher<ByteBuffer> publisher, long contentLength, org.apache.hc.core5.http.ContentType contentType, String contentEncoding) Creates a newReactiveEntityProducerwith the given parameters.- Parameters:
publisher- the publisher of the entity stream.contentLength- the length of the entity, or -1 if unknown (implies chunked encoding).contentType- theContent-Typeof the entity, or null if none.contentEncoding- theContent-Encodingof the entity, or null if none.
-
-
Method Details
-
available
public int available()- Specified by:
availablein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
-
produce
- Specified by:
producein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer- Throws:
IOException
-
releaseResources
public void releaseResources()- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-
isRepeatable
public boolean isRepeatable()- Specified by:
isRepeatablein interfaceorg.apache.hc.core5.http.nio.AsyncEntityProducer
-
failed
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncEntityProducer
-
getContentLength
public long getContentLength()- Specified by:
getContentLengthin interfaceorg.apache.hc.core5.http.EntityDetails
-
getContentType
- Specified by:
getContentTypein interfaceorg.apache.hc.core5.http.EntityDetails
-
getContentEncoding
- Specified by:
getContentEncodingin interfaceorg.apache.hc.core5.http.EntityDetails
-
isChunked
public boolean isChunked()- Specified by:
isChunkedin interfaceorg.apache.hc.core5.http.EntityDetails
-
getTrailerNames
-