java.lang.Object
io.helidon.http.media.ReadableEntityBase
io.helidon.webserver.http2.Http2ServerRequestEntity
- All Implemented Interfaces:
ReadableEntity
Server request entity.
-
Method Summary
Modifier and TypeMethodDescriptionCopy this entity and add a new runnable to be executed after this entity is consumed.static Http2ServerRequestEntity
create
(UnaryOperator<InputStream> streamFilter, UnaryOperator<InputStream> decoder, Function<Integer, BufferData> readEntityFunction, Runnable entityProcessedRunnable, ServerRequestHeaders requestHeaders, MediaContext mediaContext) Create a new entity.protected <T> T
entityAs
(GenericType<T> type) Input stream to read bytes of the entity.Methods inherited from class io.helidon.http.media.ReadableEntityBase
as, as, consume, consumed, empty, entityProcessedRunnable, hasEntity, readAllBytes, readEntityFunction
-
Method Details
-
create
public static Http2ServerRequestEntity create(UnaryOperator<InputStream> streamFilter, UnaryOperator<InputStream> decoder, Function<Integer, BufferData> readEntityFunction, Runnable entityProcessedRunnable, ServerRequestHeaders requestHeaders, MediaContext mediaContext) Create a new entity.- Parameters:
streamFilter
- stream filter to apply to the stream, provided by userdecoder
- content decoderreadEntityFunction
- function to read buffer from entity (int is an estimated number of bytes needed, buffer will contain at least 1 byte)entityProcessedRunnable
- runnable to run once the entity is fully readrequestHeaders
- request headersmediaContext
- media context to map to correct types- Returns:
- a new entity
-
copy
Description copied from interface:ReadableEntity
Copy this entity and add a new runnable to be executed after this entity is consumed.- Specified by:
copy
in interfaceReadableEntity
- Parameters:
entityProcessedRunnable
- runnable to execute on consumed entity- Returns:
- a new entity delegating to this entity
-
inputStream
Description copied from interface:ReadableEntity
Input stream to read bytes of the entity. Cannot be combined with methodsReadableEntity.as(Class)
orReadableEntity.as(io.helidon.common.GenericType)
- Specified by:
inputStream
in interfaceReadableEntity
- Overrides:
inputStream
in classReadableEntityBase
- Returns:
- input stream to entity bytes
-
entityAs
- Specified by:
entityAs
in classReadableEntityBase
-