类 StringDecoder
java.lang.Object
Decode from a data buffer stream to a
String stream, either splitting
or aggregating incoming data chunks to realign along newlines delimiters
and produce a stream of strings. This is useful for streaming but is also
necessary to ensure that that multibyte characters can be decoded correctly,
avoiding split-character issues. The default delimiters used by default are
\n and \r\n but that can be customized.- 从以下版本开始:
- 4.0
- 作者:
- Sebastien Deleuze, Brian Clozel, Arjen Poutsma, Mark Paluch, Harry Yang
- 另请参阅:
-
字段概要
从类继承的字段 cn.taketoday.core.codec.AbstractCharSequenceDecoder
DEFAULT_DELIMITERS从类继承的字段 cn.taketoday.core.codec.AbstractDecoder
logger -
构造器概要
构造器限定符构造器说明privateStringDecoder(List<String> delimiters, boolean stripDelimiter, MimeType... mimeTypes) -
方法概要
修饰符和类型方法说明static StringDecoderCreate aStringDecoderthat supports all MIME types.static StringDecoderallMimeTypes(List<String> delimiters, boolean stripDelimiter) Create aStringDecoderthat supports all MIME types.booleancanDecode(ResolvableType elementType, MimeType mimeType) Whether the decoder supports the given target element type and the MIME type of the source stream.protected StringdecodeInternal(DataBuffer dataBuffer, Charset charset) Template method that decodes the given data buffer intoT, given the charset.static StringDecoderCreate aStringDecoderfor"text/plain".static StringDecodertextPlainOnly(List<String> delimiters, boolean stripDelimiter) Create aStringDecoderfor"text/plain".从类继承的方法 cn.taketoday.core.codec.AbstractCharSequenceDecoder
decode, decode, getDefaultCharset, setDefaultCharset从类继承的方法 cn.taketoday.core.codec.AbstractDataBufferDecoder
decodeToMono, getMaxInMemorySize, setMaxInMemorySize从类继承的方法 cn.taketoday.core.codec.AbstractDecoder
getDecodableMimeTypes, getLogger, setLogger从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.core.codec.Decoder
getDecodableMimeTypes
-
构造器详细资料
-
StringDecoder
-
-
方法详细资料
-
canDecode
从接口复制的说明:DecoderWhether the decoder supports the given target element type and the MIME type of the source stream. -
decodeInternal
从类复制的说明:AbstractCharSequenceDecoderTemplate method that decodes the given data buffer intoT, given the charset.- 指定者:
decodeInternal在类中AbstractCharSequenceDecoder<String>
-
textPlainOnly
Create aStringDecoderfor"text/plain". -
textPlainOnly
Create aStringDecoderfor"text/plain".- 参数:
delimiters- delimiter strings to use to split the input streamstripDelimiter- whether to remove delimiters from the resulting input strings
-
allMimeTypes
Create aStringDecoderthat supports all MIME types. -
allMimeTypes
Create aStringDecoderthat supports all MIME types.- 参数:
delimiters- delimiter strings to use to split the input streamstripDelimiter- whether to remove delimiters from the resulting input strings
-