Class ByteArrayRequestConverterFunction
java.lang.Object
com.linecorp.armeria.server.annotation.ByteArrayRequestConverterFunction
- All Implemented Interfaces:
RequestConverterFunction
public final class ByteArrayRequestConverterFunction extends Object implements RequestConverterFunction
A default implementation of a
RequestConverterFunction
which converts a binary body of
the AggregatedHttpRequest
to one of byte[]
or HttpData
.-
Constructor Summary
Constructors Constructor Description ByteArrayRequestConverterFunction()
-
Method Summary
Modifier and Type Method Description Object
convertRequest(ServiceRequestContext ctx, AggregatedHttpRequest request, Class<?> expectedResultType)
Converts the specifiedAggregatedHttpRequest
to an object ofexpectedResultType
.
-
Constructor Details
-
ByteArrayRequestConverterFunction
public ByteArrayRequestConverterFunction()
-
-
Method Details
-
convertRequest
public Object convertRequest(ServiceRequestContext ctx, AggregatedHttpRequest request, Class<?> expectedResultType) throws ExceptionConverts the specifiedAggregatedHttpRequest
to an object ofexpectedResultType
. This converter allows onlybyte[]
andHttpData
as its return type, andAggregatedHttpRequest
would be consumed only if it does not have aContent-Type
header or if it hasContent-Type: application/octet-stream
orContent-Type: application/binary
.- Specified by:
convertRequest
in interfaceRequestConverterFunction
- Throws:
Exception
-