Package org.springframework.http.codec

# Class KotlinSerializationStringDecoder<T extends kotlinx.serialization.StringFormat>

java.lang.Object
org.springframework.http.codec.KotlinSerializationSupport<T>
org.springframework.http.codec.KotlinSerializationStringDecoder<T>

Type Parameters:
  `T` - the type of `StringFormat`

All Implemented Interfaces:
  `org.springframework.core.codec.Decoder<Object>`

Direct Known Subclasses:
  `KotlinSerializationJsonDecoder`

public abstract class KotlinSerializationStringDecoder<T extends kotlinx.serialization.StringFormat> extends KotlinSerializationSupport<T> implements org.springframework.core.codec.Decoder<Object>
Abstract base class for `Decoder` implementations that defer to Kotlin string serializers.

Since:
  6.0
Author:
  Sebastien Deleuze, Iain Henderson, Arjen Poutsma

## Constructor Summary

Constructors
Constructor
Description
`KotlinSerializationStringDecoder(T format, org.springframework.util.MimeType... supportedMimeTypes)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`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>`
`getDecodableMimeTypes()`
`List<org.springframework.util.MimeType>`
`getDecodableMimeTypes(org.springframework.core.ResolvableType targetType)`
`int`
`getMaxInMemorySize()`
Return the `configured` 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

### KotlinSerializationStringDecoder

public KotlinSerializationStringDecoder(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 single `DataBuffer`, `ByteBuffer`, `byte[]`, `Resource`, `String`, etc. It can also occur when splitting the input stream, for example, 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 the `configured` byte count limit.

### canDecode

public boolean canDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType)

Specified by:
  `canDecode` in interface `org.springframework.core.codec.Decoder<T extends kotlinx.serialization.StringFormat>`

### getDecodableMimeTypes

public List<org.springframework.util.MimeType> getDecodableMimeTypes()

Specified by:
  `getDecodableMimeTypes` in interface `org.springframework.core.codec.Decoder<T extends kotlinx.serialization.StringFormat>`

### getDecodableMimeTypes

public List<org.springframework.util.MimeType> getDecodableMimeTypes(org.springframework.core.ResolvableType targetType)

Specified by:
  `getDecodableMimeTypes` in interface `org.springframework.core.codec.Decoder<T extends kotlinx.serialization.StringFormat>`

### 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 interface `org.springframework.core.codec.Decoder<T extends kotlinx.serialization.StringFormat>`

### 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 interface `org.springframework.core.codec.Decoder<T extends kotlinx.serialization.StringFormat>`