Package ru.tinkoff.kora.http.common.body
Class DefaultFullHttpBody
java.lang.Object
ru.tinkoff.kora.http.common.body.DefaultFullHttpBody
- All Implemented Interfaces:
Closeable,AutoCloseable,Flow.Publisher<ByteBuffer>,HttpBody,HttpBodyInput,HttpBodyOutput
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFullHttpBody(ru.tinkoff.kora.common.Context context, ByteBuffer data, String contentType) -
Method Summary
Modifier and TypeMethodDescriptionCompletionStage<byte[]>voidclose()intvoidsubscribe(Flow.Subscriber<? super ByteBuffer> subscriber) voidwrite(OutputStream os)
-
Constructor Details
-
DefaultFullHttpBody
public DefaultFullHttpBody(ru.tinkoff.kora.common.Context context, ByteBuffer data, @Nullable String contentType)
-
-
Method Details
-
contentLength
public int contentLength()- Specified by:
contentLengthin interfaceHttpBody- Specified by:
contentLengthin interfaceHttpBodyOutput
-
contentType
- Specified by:
contentTypein interfaceHttpBody- Specified by:
contentTypein interfaceHttpBodyOutput
-
getFullContentIfAvailable
- Specified by:
getFullContentIfAvailablein interfaceHttpBody
-
asBufferStage
- Specified by:
asBufferStagein interfaceHttpBodyInput
-
asArrayStage
- Specified by:
asArrayStagein interfaceHttpBodyInput
-
subscribe
- Specified by:
subscribein interfaceFlow.Publisher<ByteBuffer>- Specified by:
subscribein interfaceHttpBodyInput- Specified by:
subscribein interfaceHttpBodyOutput
-
write
- Specified by:
writein interfaceHttpBodyOutput- Throws:
IOException
-
asInputStream
- Specified by:
asInputStreamin interfaceHttpBodyInput
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-