类 DataBufferDecoder
- java.lang.Object
- org.springframework.core.codec.AbstractDecoder<T>
- org.springframework.core.codec.AbstractDataBufferDecoder<DataBuffer>
- org.springframework.core.codec.DataBufferDecoder
- 所有已实现的接口:
Decoder<DataBuffer>
public class DataBufferDecoder extends AbstractDataBufferDecoder<DataBuffer>
Simple pass-through decoder forDataBuffers
.Note: The data buffers should be released via
DataBufferUtils.release(DataBuffer)
after they have been consumed. In addition, if usingFlux
orMono
operators such as flatMap, reduce, and others that prefetch, cache, and skip or filter out data items internally, please adddoOnDiscard(PooledDataBuffer.class, DataBufferUtils::release)
to the composition chain to ensure cached data buffers are released prior to an error or cancellation signal.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.core.codec.AbstractDecoder
logger
构造器概要
构造器 构造器 说明 DataBufferDecoder()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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> input, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)
Decode aDataBuffer
input stream into a Flux ofT
.DataBuffer
decode(DataBuffer buffer, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)
Decode a data buffer to an Object of type T.从类继承的方法 org.springframework.core.codec.AbstractDataBufferDecoder
decodeDataBuffer, decodeToMono, getMaxInMemorySize, setMaxInMemorySize
从类继承的方法 org.springframework.core.codec.AbstractDecoder
getDecodableMimeTypes, getLogger, setLogger
构造器详细资料
DataBufferDecoder
public DataBufferDecoder()
方法详细资料
canDecode
public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
从接口复制的说明:Decoder
Whether the decoder supports the given target element type and the MIME type of the source stream.- 指定者:
canDecode
在接口中Decoder<DataBuffer>
- 覆盖:
canDecode
在类中AbstractDecoder<DataBuffer>
- 参数:
elementType
- the target element type for the output streammimeType
- the mime type associated with the stream to decode (can benull
if not specified)- 返回:
true
if supported,false
otherwise
decode
public reactor.core.publisher.Flux<DataBuffer> decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明:Decoder
Decode aDataBuffer
input stream into a Flux ofT
.- 指定者:
decode
在接口中Decoder<DataBuffer>
- 覆盖:
decode
在类中AbstractDataBufferDecoder<DataBuffer>
- 参数:
input
- theDataBuffer
input stream to decodeelementType
- the expected type of elements in the output stream; this type must have been previously passed to theDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returnedtrue
.mimeType
- the MIME type associated with the input stream (optional)hints
- additional information about how to do encode- 返回:
- the output stream with decoded elements
decode
public DataBuffer decode(DataBuffer buffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明:Decoder
Decode a data buffer to an Object of type T. This is useful for scenarios, that distinct messages (or events) are decoded and handled individually, in fully aggregated form.- 参数:
buffer
- theDataBuffer
to decodeelementType
- the expected output typemimeType
- the MIME type associated with the datahints
- additional information about how to do encode- 返回:
- the decoded value, possibly
null