类 ByteArrayDecoder
- java.lang.Object
- org.springframework.core.codec.AbstractDecoder<T>
- org.springframework.core.codec.AbstractDataBufferDecoder<byte[]>
- org.springframework.core.codec.ByteArrayDecoder
- 所有已实现的接口:
Decoder<byte[]>
public class ByteArrayDecoder extends AbstractDataBufferDecoder<byte[]>
Decoder forbytearrays.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.core.codec.AbstractDecoder
logger
构造器概要
构造器 构造器 说明 ByteArrayDecoder()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleancanDecode(ResolvableType elementType, MimeType mimeType)Whether the decoder supports the given target element type and the MIME type of the source stream.byte[]decode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)Decode a data buffer to an Object of type T.从类继承的方法 org.springframework.core.codec.AbstractDataBufferDecoder
decode, decodeDataBuffer, decodeToMono, getMaxInMemorySize, setMaxInMemorySize
从类继承的方法 org.springframework.core.codec.AbstractDecoder
getDecodableMimeTypes, getLogger, setLogger
构造器详细资料
ByteArrayDecoder
public ByteArrayDecoder()
方法详细资料
canDecode
public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
从接口复制的说明:DecoderWhether the decoder supports the given target element type and the MIME type of the source stream.- 指定者:
canDecode在接口中Decoder<byte[]>- 覆盖:
canDecode在类中AbstractDecoder<byte[]>- 参数:
elementType- the target element type for the output streammimeType- the mime type associated with the stream to decode (can benullif not specified)- 返回:
trueif supported,falseotherwise
decode
public byte[] decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明:DecoderDecode 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.- 参数:
dataBuffer- theDataBufferto decodeelementType- the expected output typemimeType- the MIME type associated with the datahints- additional information about how to do encode- 返回:
- the decoded value, possibly
null