public class DataBufferDecoder extends AbstractDataBufferDecoder<DataBuffer>
DataBuffers.
Note that the "decoded" buffers returned by instances of this class should
be released after usage by calling
DataBufferUtils.release(DataBuffer).
| Constructor and Description |
|---|
DataBufferDecoder() |
| 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.
|
reactor.core.publisher.Flux<DataBuffer> |
decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
java.util.Map<java.lang.String,java.lang.Object> hints)
Decode a
DataBuffer input stream into a Flux of T. |
protected DataBuffer |
decodeDataBuffer(DataBuffer buffer,
ResolvableType elementType,
MimeType mimeType,
java.util.Map<java.lang.String,java.lang.Object> hints)
How to decode a
DataBuffer to the target element type. |
decodeToMonogetDecodableMimeTypespublic boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
DecodercanDecode in interface Decoder<DataBuffer>canDecode in class AbstractDecoder<DataBuffer>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 otherwisepublic reactor.core.publisher.Flux<DataBuffer> decode(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable java.util.Map<java.lang.String,java.lang.Object> hints)
DecoderDataBuffer input stream into a Flux of T.decode in interface Decoder<DataBuffer>decode in class AbstractDataBufferDecoder<DataBuffer>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 Decoder.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 encodeprotected DataBuffer decodeDataBuffer(DataBuffer buffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable java.util.Map<java.lang.String,java.lang.Object> hints)
AbstractDataBufferDecoderDataBuffer to the target element type.decodeDataBuffer in class AbstractDataBufferDecoder<DataBuffer>