クラス AbstractDataBufferDecoder<T>
- 型パラメーター:
T
- 要素型
- 実装されたすべてのインターフェース:
Decoder<T>
- 既知の直属サブクラス
AbstractCharSequenceDecoder
、ByteArrayDecoder
、ByteBufferDecoder
、DataBufferDecoder
、Netty5BufferDecoder
、NettyByteBufDecoder
、ResourceDecoder
DataBuffer
をターゲット要素型に直接デコードできる Decoder
実装の抽象基本クラス。 サブクラスは decodeDataBuffer(org.springframework.core.io.buffer.DataBuffer, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
を実装して、DataBuffer
をターゲットのデータ型に変換する方法を提供する必要があります。デフォルトの decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
実装は個々のデータバッファーを変換し、decodeToMono(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
は「削減」を適用して集約バッファーを変換します。
サブクラスは、decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
をオーバーライドして、入力ストリームを異なる境界に沿って分割したり(たとえば、String
の改行文字で)、常に単一のデータバッファー(Resource
など)に削減したりできます。
- 導入:
- 5.0
- 作成者:
- Rossen Stoyanchev
フィールドサマリー
クラス org.springframework.core.codec.AbstractDecoder から継承されたフィールド
logger
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明reactor.core.publisher.Flux<T>
decode
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer
入力ストリームをT
の Flux にデコードします。protected T
decodeDataBuffer
(DataBuffer buffer, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) 使用すべきではありません。reactor.core.publisher.Mono<T>
decodeToMono
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer
入力ストリームをT
の Mono にデコードします。int
configured
バイトカウント制限を返します。void
setMaxInMemorySize
(int byteCount) 入力ストリームを集約する必要があるときはいつでもバッファリングできるバイト数の制限を構成します。クラス org.springframework.core.codec.AbstractDecoder から継承されたメソッド
canDecode, getDecodableMimeTypes, getLogger, setLogger
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.core.codec.Decoder から継承されたメソッド
decode, getDecodableMimeTypes
コンストラクターの詳細
AbstractDataBufferDecoder
メソッドの詳細
setMaxInMemorySize
public void setMaxInMemorySize(int byteCount) 入力ストリームを集約する必要があるときはいつでもバッファリングできるバイト数の制限を構成します。これは、単一のDataBuffer
、ByteBuffer
SE、byte[]
、Resource
、String
などへのデコードの結果である可能性があります。区切りテキスト。この場合、制限は区切り文字間でバッファリングされるデータに適用されます。デフォルトでは、これは 256K に設定されています。
- パラメーター:
byteCount
- バッファリングする最大バイト数、または無制限の場合は -1- 導入:
- 5.1.11
getMaxInMemorySize
public int getMaxInMemorySize()configured
バイトカウント制限を返します。- 導入:
- 5.1.11
decode
public reactor.core.publisher.Flux<T> decode(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) インターフェースからコピーされた説明:Decoder
DataBuffer
入力ストリームをT
の Flux にデコードします。- パラメーター:
input
- デコードするDataBuffer
入力ストリームelementType
- 出力ストリーム内の要素の予想される型。この型は、事前にDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
メソッドに渡されている必要があり、true
を返している必要があります。mimeType
- 入力ストリームに関連付けられた MIME 型 (オプション)hints
- デコード方法に関する追加情報- 戻り値:
- デコードされた要素を含む出力ストリーム
decodeToMono
public reactor.core.publisher.Mono<T> decodeToMono(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) インターフェースからコピーされた説明:Decoder
DataBuffer
入力ストリームをT
の Mono にデコードします。- 次で指定:
- インターフェース
Decoder<T>
のdecodeToMono
- オーバーライド:
- クラス
AbstractDecoder<T>
のdecodeToMono
- パラメーター:
input
- デコードするDataBuffer
入力ストリームelementType
- 出力ストリーム内の要素の予想される型。この型は、事前にDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
メソッドに渡されている必要があり、true
を返している必要があります。mimeType
- 入力ストリームに関連付けられた MIME 型 (オプション)hints
- デコード方法に関する追加情報- 戻り値:
- デコードされた要素を持つ出力ストリーム
decodeDataBuffer
@DeprecatedSE @Nullable protected T decodeDataBuffer(DataBuffer buffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) 使用すべきではありません。5.2 現在、代わりにDecoder.decode(DataBuffer, ResolvableType, MimeType, Map)
を実装してくださいDataBuffer
をターゲット要素型にデコードする方法。
Decoder.decode(DataBuffer, ResolvableType, MimeType, Map)
を実装してください