T - the type of elements in the output streampublic interface Decoder<T>
DataBuffer input stream into an output stream
of elements of type <T>.| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecode(ResolvableType elementType,
MimeType mimeType)
Whether the decoder supports the given target element type and the MIME
type of the source stream.
|
default T |
decode(DataBuffer buffer,
ResolvableType targetType,
MimeType mimeType,
Map<String,Object> hints)
Decode a data buffer to an Object of type T.
|
reactor.core.publisher.Flux<T> |
decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Flux of T. |
reactor.core.publisher.Mono<T> |
decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Mono of T. |
List<MimeType> |
getDecodableMimeTypes()
Return the list of MIME types this decoder supports.
|
boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
elementType - the target element type for the output streammimeType - the mime type associated with the stream to decode
(can be null if not specified)true if supported, false otherwisereactor.core.publisher.Flux<T> decode(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
DataBuffer input stream into a Flux of T.inputStream - the DataBuffer input stream to decodeelementType - the expected type of elements in the output stream;
this type must have been previously passed to the canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returned true.mimeType - the MIME type associated with the input stream (optional)hints - additional information about how to do encodereactor.core.publisher.Mono<T> decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
DataBuffer input stream into a Mono of T.inputStream - the DataBuffer input stream to decodeelementType - the expected type of elements in the output stream;
this type must have been previously passed to the canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returned true.mimeType - the MIME type associated with the input stream (optional)hints - additional information about how to do encodedefault T decode(DataBuffer buffer, ResolvableType targetType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints) throws DecodingException
buffer - the DataBuffer to decodetargetType - the expected output typemimeType - the MIME type associated with the datahints - additional information about how to do encodenullDecodingException