spring-framework / org.springframework.core.codec / StringDecoder

StringDecoder

open class StringDecoder : AbstractDecoder<String>

Decode from a bytes stream to a String stream.

By default, this decoder will split the received DataBuffers along newline characters (\r\n), but this can be changed by passing false as a constructor argument.

Author
Sebastien Deleuze

Author
Brian Clozel

Author
Arjen Poutsma

Author
Mark Paluch

Since
5.0

See Also
CharSequenceEncoder

Properties

DEFAULT_CHARSET

static val DEFAULT_CHARSET: Charset

Functions

allMimeTypes

open static fun allMimeTypes(splitOnNewline: Boolean): StringDecoder

Create a StringDecoder that supports all MIME types.

canDecode

open fun canDecode(elementType: ResolvableType, mimeType: MimeType): Boolean

decode

open fun decode(inputStream: Publisher<DataBuffer>, elementType: ResolvableType, mimeType: MimeType, hints: MutableMap<String, Any>): Flux<String>

decodeToMono

open fun decodeToMono(inputStream: Publisher<DataBuffer>, elementType: ResolvableType, mimeType: MimeType, hints: MutableMap<String, Any>): Mono<String>

textPlainOnly

open static fun textPlainOnly(splitOnNewline: Boolean): StringDecoder

Create a StringDecoder for "text/plain".