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 Http2ServerRequestEntitycreate(UnaryOperator<InputStream> streamFilter, UnaryOperator<InputStream> decoder, Function<Integer, BufferData> readEntityFunction, Runnable entityProcessedRunnable, ServerRequestHeaders requestHeaders, MediaContext mediaContext) Create a new entity.protected <T> TentityAs(GenericType<T> type) Read entity as a specific generic type.Input stream to read bytes of the entity.Methods inherited from class io.helidon.http.media.ReadableEntityBase
as, as, asOptional, consume, consumed, empty, entityProcessedRunnable, hasEntity, readAllBytes, readEntityFunctionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.http.media.ReadableEntity
as, as, asOptional, asOptional, consume, consumed, hasEntity
-
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:ReadableEntityCopy this entity and add a new runnable to be executed after this entity is consumed.- Specified by:
copyin interfaceReadableEntity- Parameters:
entityProcessedRunnable- runnable to execute on consumed entity- Returns:
- a new entity delegating to this entity
-
inputStream
Description copied from interface:ReadableEntityInput stream to read bytes of the entity. Cannot be combined with methodsReadableEntity.as(Class)orReadableEntity.as(io.helidon.common.GenericType)If there is no entity, returns input stream on empty byte array.- Specified by:
inputStreamin interfaceReadableEntity- Overrides:
inputStreamin classReadableEntityBase- Returns:
- input stream to entity bytes
-
entityAs
Description copied from class:ReadableEntityBaseRead entity as a specific generic type.- Specified by:
entityAsin classReadableEntityBase- Type Parameters:
T- type of the entity- Parameters:
type- type the entity should be coerced into- Returns:
- entity value
-