类 ProtobufDecoder.MessageDecoderFunction
java.lang.Object
cn.taketoday.http.codec.protobuf.ProtobufDecoder.MessageDecoderFunction
- 所有已实现的接口:
Function<cn.taketoday.core.io.buffer.DataBuffer,Iterable<? extends com.google.protobuf.Message>>
- 封闭类:
- ProtobufDecoder
-
字段概要
字段修饰符和类型字段说明private final cn.taketoday.core.ResolvableTypeprivate final intprivate intprivate intprivate cn.taketoday.core.io.buffer.DataBuffer -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Iterable<? extends com.google.protobuf.Message>apply(cn.taketoday.core.io.buffer.DataBuffer input) voiddiscard()private booleanreadMessageSize(cn.taketoday.core.io.buffer.DataBuffer input) Parse message size as a varint from the input stream, updatingmessageBytesToReadandoffsetfields if needed to allow processing of upcoming chunks.
-
字段详细资料
-
elementType
private final cn.taketoday.core.ResolvableType elementType -
maxMessageSize
private final int maxMessageSize -
output
@Nullable private cn.taketoday.core.io.buffer.DataBuffer output -
messageBytesToRead
private int messageBytesToRead -
offset
private int offset
-
-
构造器详细资料
-
MessageDecoderFunction
public MessageDecoderFunction(cn.taketoday.core.ResolvableType elementType, int maxMessageSize)
-
-
方法详细资料
-
apply
public Iterable<? extends com.google.protobuf.Message> apply(cn.taketoday.core.io.buffer.DataBuffer input) -
readMessageSize
private boolean readMessageSize(cn.taketoday.core.io.buffer.DataBuffer input) Parse message size as a varint from the input stream, updatingmessageBytesToReadandoffsetfields if needed to allow processing of upcoming chunks. Inspired fromCodedInputStream.readRawVarint32(int, java.io.InputStream)- 返回:
- {code true} when the message size is parsed successfully, {code false} when the message size is truncated
- 另请参阅:
-
discard
public void discard()
-