Package org.springframework.http.codec
Class KotlinSerializationBinaryDecoder<T extends kotlinx.serialization.BinaryFormat>
java.lang.Object
org.springframework.http.codec.KotlinSerializationSupport<T>
org.springframework.http.codec.KotlinSerializationBinaryDecoder<T>
- Type Parameters:
T
- the type ofBinaryFormat
- All Implemented Interfaces:
org.springframework.core.codec.Decoder<Object>
- Direct Known Subclasses:
KotlinSerializationCborDecoder
,KotlinSerializationProtobufDecoder
public abstract class KotlinSerializationBinaryDecoder<T extends kotlinx.serialization.BinaryFormat>
extends KotlinSerializationSupport<T>
implements org.springframework.core.codec.Decoder<Object>
Abstract base class for
Decoder
implementations that defer to Kotlin
binary serializers.- Since:
- 6.0
- Author:
- Sebastien Deleuze, Iain Henderson, Arjen Poutsma
-
Constructor Summary
ConstructorDescriptionKotlinSerializationBinaryDecoder
(T format, org.springframework.util.MimeType... supportedMimeTypes) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecode
(org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType) reactor.core.publisher.Flux<Object>
decode
(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Mono<Object>
decodeToMono
(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) List<org.springframework.util.MimeType>
List<org.springframework.util.MimeType>
getDecodableMimeTypes
(org.springframework.core.ResolvableType targetType) int
Return theconfigured
byte count limit.void
setMaxInMemorySize
(int byteCount) Configure a limit on the number of bytes that can be buffered whenever the input stream needs to be aggregated.Methods inherited from class org.springframework.http.codec.KotlinSerializationSupport
canSerialize, format, serializer, supportedMimeTypes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.codec.Decoder
decode
-
Constructor Details
-
KotlinSerializationBinaryDecoder
public KotlinSerializationBinaryDecoder(T format, org.springframework.util.MimeType... supportedMimeTypes)
-
-
Method Details
-
setMaxInMemorySize
public void setMaxInMemorySize(int byteCount) Configure a limit on the number of bytes that can be buffered whenever the input stream needs to be aggregated. This can be a result of decoding to a singleDataBuffer
,ByteBuffer
,byte[]
,Resource
,String
, etc. It can also occur when splitting the input stream, e.g. delimited text, in which case the limit applies to data buffered between delimiters.By default this is set to 256K.
- Parameters:
byteCount
- the max number of bytes to buffer, or -1 for unlimited
-
getMaxInMemorySize
public int getMaxInMemorySize()Return theconfigured
byte count limit. -
canDecode
public boolean canDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType) - Specified by:
canDecode
in interfaceorg.springframework.core.codec.Decoder<T extends kotlinx.serialization.BinaryFormat>
-
getDecodableMimeTypes
- Specified by:
getDecodableMimeTypes
in interfaceorg.springframework.core.codec.Decoder<T extends kotlinx.serialization.BinaryFormat>
-
getDecodableMimeTypes
public List<org.springframework.util.MimeType> getDecodableMimeTypes(org.springframework.core.ResolvableType targetType) - Specified by:
getDecodableMimeTypes
in interfaceorg.springframework.core.codec.Decoder<T extends kotlinx.serialization.BinaryFormat>
-
decode
public reactor.core.publisher.Flux<Object> decode(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints) - Specified by:
decode
in interfaceorg.springframework.core.codec.Decoder<T extends kotlinx.serialization.BinaryFormat>
-
decodeToMono
public reactor.core.publisher.Mono<Object> decodeToMono(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints) - Specified by:
decodeToMono
in interfaceorg.springframework.core.codec.Decoder<T extends kotlinx.serialization.BinaryFormat>
-