类 PartEventHttpMessageReader
java.lang.Object
cn.taketoday.http.codec.LoggingCodecSupport
cn.taketoday.http.codec.multipart.PartEventHttpMessageReader
- 所有已实现的接口:
HttpMessageReader<PartEvent>
public class PartEventHttpMessageReader
extends LoggingCodecSupport
implements HttpMessageReader<PartEvent>
- 从以下版本开始:
- 4.0 2022/4/22 9:10
- 作者:
- Arjen Poutsma, Harry Yang
- 另请参阅:
-
字段概要
字段从类继承的字段 cn.taketoday.http.codec.LoggingCodecSupport
logger -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanWhether the given object type is supported by this reader.private org.reactivestreams.Publisher<? extends PartEvent>createEvents(HttpHeaders headers, reactor.core.publisher.Flux<MultipartParser.BodyToken> bodyTokens) intGet theconfiguredmaximum in-memory size.Return the list of media types supported by this reader.reactor.core.publisher.Flux<PartEvent>read(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Read from the input message and decode to a stream of objects.reactor.core.publisher.Mono<PartEvent>readMono(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Read from the input message and decode to a single object.voidsetHeadersCharset(Charset headersCharset) Set the character set used to decode headers.voidsetMaxHeadersSize(int byteCount) Configure the maximum amount of memory that is allowed per headers section of each part.voidsetMaxInMemorySize(int maxInMemorySize) Configure the maximum amount of memory allowed for form fields.从类继承的方法 cn.taketoday.http.codec.LoggingCodecSupport
isEnableLoggingRequestDetails, setEnableLoggingRequestDetails从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.codec.HttpMessageReader
getReadableMediaTypes, read, readMono
-
字段详细资料
-
maxInMemorySize
private int maxInMemorySize -
maxHeadersSize
private int maxHeadersSize -
headersCharset
-
-
构造器详细资料
-
PartEventHttpMessageReader
public PartEventHttpMessageReader()
-
-
方法详细资料
-
getMaxInMemorySize
public int getMaxInMemorySize()Get theconfiguredmaximum in-memory size. -
setMaxInMemorySize
public void setMaxInMemorySize(int maxInMemorySize) Configure the maximum amount of memory allowed for form fields. When the limit is exceeded, form fields parts are rejected withDataBufferLimitException.By default this is set to 256K.
- 参数:
maxInMemorySize- the in-memory limit in bytes; if set to -1 the entire contents will be stored in memory
-
setMaxHeadersSize
public void setMaxHeadersSize(int byteCount) Configure the maximum amount of memory that is allowed per headers section of each part. Defaults to 10K.- 参数:
byteCount- the maximum amount of memory for headers
-
setHeadersCharset
Set the character set used to decode headers. Defaults to UTF-8 as per RFC 7578.- 参数:
headersCharset- the charset to use for decoding headers- 另请参阅:
-
getReadableMediaTypes
从接口复制的说明:HttpMessageReaderReturn the list of media types supported by this reader. The list may not apply to every possible target element type and calls to this method should typically be guarded viacanWrite(elementType, null). The list may also exclude media types supported only for a specific element type. Alternatively, useHttpMessageReader.getReadableMediaTypes(ResolvableType)for a more precise list.- 指定者:
getReadableMediaTypes在接口中HttpMessageReader<PartEvent>- 返回:
- the general list of supported media types
-
canRead
从接口复制的说明:HttpMessageReaderWhether the given object type is supported by this reader.- 指定者:
canRead在接口中HttpMessageReader<PartEvent>- 参数:
elementType- the type of object to checkmediaType- the media type for the read (possiblynull)- 返回:
trueif readable,falseotherwise
-
readMono
public reactor.core.publisher.Mono<PartEvent> readMono(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) 从接口复制的说明:HttpMessageReaderRead from the input message and decode to a single object.- 指定者:
readMono在接口中HttpMessageReader<PartEvent>- 参数:
elementType- the type of objects in the stream which must have been previously checked viaHttpMessageReader.canRead(ResolvableType, MediaType)message- the message to read fromhints- additional information about how to read and decode the input- 返回:
- the decoded object
-
read
public reactor.core.publisher.Flux<PartEvent> read(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) 从接口复制的说明:HttpMessageReaderRead from the input message and decode to a stream of objects.- 指定者:
read在接口中HttpMessageReader<PartEvent>- 参数:
elementType- the type of objects in the stream which must have been previously checked viaHttpMessageReader.canRead(ResolvableType, MediaType)message- the message to read fromhints- additional information about how to read and decode the input- 返回:
- the decoded stream of elements
-
createEvents
private org.reactivestreams.Publisher<? extends PartEvent> createEvents(HttpHeaders headers, reactor.core.publisher.Flux<MultipartParser.BodyToken> bodyTokens)
-