Top Description Constructors Methods
org.springframework.core.codec

public Class NettyByteBufDecoder

extends AbstractDataBufferDecoder<ByteBuf>
Class Inheritance
Imports
java.util.Map, io.netty.buffer.ByteBuf, .Unpooled, org.springframework.core.ResolvableType, org.springframework.core.io.buffer.DataBuffer, .DataBufferUtils, .NettyDataBuffer, org.springframework.lang.Nullable, org.springframework.util.MimeType, .MimeTypeUtils

Decoder for ByteBufs.
Author
Vladislav Kisel
Since
5.3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canDecode(ResolvableType
the target element type for the output stream
elementType
,
MimeType
the mime type associated with the stream to decode (can be null if not specified)
mimeType
)

Overrides org.springframework.core.codec.AbstractDecoder.canDecode.

Implements org.springframework.core.codec.Decoder.canDecode.

Whether the decoder supports the given target element type and the MIME type of the source stream.

public ByteBuf
decode(DataBuffer
the DataBuffer to decode
dataBuffer
,
ResolvableType
the expected output type
elementType
,
MimeType
the MIME type associated with the data
mimeType
,
Map<String, Object>
additional information about how to do decode
hints
)

Overrides default org.springframework.core.codec.Decoder.decode.

Decode a data buffer to an Object of type T.

Inherited from org.springframework.core.codec.AbstractDataBufferDecoder:
decodedecodeDataBufferdecodeToMonogetMaxInMemorySizesetMaxInMemorySize

Constructor Detail

NettyByteBufDecoderback to summary
public NettyByteBufDecoder()

Method Detail

canDecodeback to summary
public boolean canDecode(ResolvableType elementType, MimeType mimeType)

Overrides org.springframework.core.codec.AbstractDecoder.canDecode.

Implements org.springframework.core.codec.Decoder.canDecode.

Doc from org.springframework.core.codec.Decoder.canDecode.

Whether the decoder supports the given target element type and the MIME type of the source stream.

Parameters
elementType:ResolvableType

the target element type for the output stream

mimeType:MimeType

the mime type associated with the stream to decode (can be null if not specified)

Returns:boolean

true if supported, false otherwise

Annotations
@Override
decodeback to summary
public ByteBuf decode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints)

Overrides default org.springframework.core.codec.Decoder.decode.

Doc from org.springframework.core.codec.Decoder.decode.

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.

Parameters
dataBuffer:DataBuffer

the DataBuffer to decode

elementType:ResolvableType

the expected output type

mimeType:MimeType

the MIME type associated with the data

hints:Map<String, Object>

additional information about how to do decode

Returns:ByteBuf

the decoded value, possibly null

Annotations
@Override