Package com.google.protobuf
Class CodedInputStreamReader
- java.lang.Object
-
- com.google.protobuf.CodedInputStreamReader
-
@CheckReturnValue @ExperimentalApi final class CodedInputStreamReader extends java.lang.Object
A reader of fields from a serialized protobuf message.
-
-
Field Summary
Fields Modifier and Type Field Description private intendGroupTagprivate static intFIXED32_MULTIPLE_MASKprivate static intFIXED64_MULTIPLE_MASKprivate CodedInputStreaminputprivate static intNEXT_TAG_UNSETprivate intnextTag(package private) static intREAD_DONEprivate inttag
-
Constructor Summary
Constructors Modifier Constructor Description privateCodedInputStreamReader(CodedInputStream input)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CodedInputStreamReaderforCodedInput(CodedInputStream input)intgetFieldNumber()intgetTag()<T> voidmergeGroupField(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry)private <T> voidmergeGroupFieldInternal(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry)<T> voidmergeMessageField(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry)private <T> voidmergeMessageFieldInternal(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry)booleanreadBool()voidreadBoolList(java.util.List<java.lang.Boolean> target)ByteStringreadBytes()voidreadBytesList(java.util.List<ByteString> target)doublereadDouble()voidreadDoubleList(java.util.List<java.lang.Double> target)intreadEnum()voidreadEnumList(java.util.List<java.lang.Integer> target)private java.lang.ObjectreadField(WireFormat.FieldType fieldType, java.lang.Class<?> messageType, ExtensionRegistryLite extensionRegistry)intreadFixed32()voidreadFixed32List(java.util.List<java.lang.Integer> target)longreadFixed64()voidreadFixed64List(java.util.List<java.lang.Long> target)floatreadFloat()voidreadFloatList(java.util.List<java.lang.Float> target)private <T> TreadGroup(Schema<T> schema, ExtensionRegistryLite extensionRegistry)<T> TreadGroup(java.lang.Class<T> clazz, ExtensionRegistryLite extensionRegistry)Deprecated.<T> TreadGroupBySchemaWithCheck(Schema<T> schema, ExtensionRegistryLite extensionRegistry)Deprecated.<T> voidreadGroupList(java.util.List<T> target, Schema<T> schema, ExtensionRegistryLite extensionRegistry)Deprecated.<T> voidreadGroupList(java.util.List<T> target, java.lang.Class<T> targetType, ExtensionRegistryLite extensionRegistry)Deprecated.intreadInt32()voidreadInt32List(java.util.List<java.lang.Integer> target)longreadInt64()voidreadInt64List(java.util.List<java.lang.Long> target)<K,V>
voidreadMap(java.util.Map<K,V> target, MapEntryLite.Metadata<K,V> metadata, ExtensionRegistryLite extensionRegistry)private <T> TreadMessage(Schema<T> schema, ExtensionRegistryLite extensionRegistry)<T> TreadMessage(java.lang.Class<T> clazz, ExtensionRegistryLite extensionRegistry)<T> TreadMessageBySchemaWithCheck(Schema<T> schema, ExtensionRegistryLite extensionRegistry)<T> voidreadMessageList(java.util.List<T> target, Schema<T> schema, ExtensionRegistryLite extensionRegistry)<T> voidreadMessageList(java.util.List<T> target, java.lang.Class<T> targetType, ExtensionRegistryLite extensionRegistry)intreadSFixed32()voidreadSFixed32List(java.util.List<java.lang.Integer> target)longreadSFixed64()voidreadSFixed64List(java.util.List<java.lang.Long> target)intreadSInt32()voidreadSInt32List(java.util.List<java.lang.Integer> target)longreadSInt64()voidreadSInt64List(java.util.List<java.lang.Long> target)java.lang.StringreadString()voidreadStringList(java.util.List<java.lang.String> target)voidreadStringListInternal(java.util.List<java.lang.String> target, boolean requireUtf8)voidreadStringListRequireUtf8(java.util.List<java.lang.String> target)java.lang.StringreadStringRequireUtf8()intreadUInt32()voidreadUInt32List(java.util.List<java.lang.Integer> target)longreadUInt64()voidreadUInt64List(java.util.List<java.lang.Long> target)private voidrequirePosition(int expectedPosition)private voidrequireWireType(int requiredWireType)booleanshouldDiscardUnknownFields()booleanskipField()private voidverifyPackedFixed32Length(int bytes)private voidverifyPackedFixed64Length(int bytes)
-
-
-
Field Detail
-
READ_DONE
static final int READ_DONE
- See Also:
- Constant Field Values
-
FIXED32_MULTIPLE_MASK
private static final int FIXED32_MULTIPLE_MASK
- See Also:
- Constant Field Values
-
FIXED64_MULTIPLE_MASK
private static final int FIXED64_MULTIPLE_MASK
- See Also:
- Constant Field Values
-
NEXT_TAG_UNSET
private static final int NEXT_TAG_UNSET
- See Also:
- Constant Field Values
-
input
private final CodedInputStream input
-
tag
private int tag
-
endGroupTag
private int endGroupTag
-
nextTag
private int nextTag
-
-
Constructor Detail
-
CodedInputStreamReader
private CodedInputStreamReader(CodedInputStream input)
-
-
Method Detail
-
forCodedInput
public static CodedInputStreamReader forCodedInput(CodedInputStream input)
-
shouldDiscardUnknownFields
public boolean shouldDiscardUnknownFields()
-
getFieldNumber
public int getFieldNumber() throws java.io.IOException- Throws:
java.io.IOException
-
getTag
public int getTag()
-
skipField
public boolean skipField() throws java.io.IOException- Throws:
java.io.IOException
-
requireWireType
private void requireWireType(int requiredWireType) throws java.io.IOException- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException- Throws:
java.io.IOException
-
readUInt64
public long readUInt64() throws java.io.IOException- Throws:
java.io.IOException
-
readInt64
public long readInt64() throws java.io.IOException- Throws:
java.io.IOException
-
readInt32
public int readInt32() throws java.io.IOException- Throws:
java.io.IOException
-
readFixed64
public long readFixed64() throws java.io.IOException- Throws:
java.io.IOException
-
readFixed32
public int readFixed32() throws java.io.IOException- Throws:
java.io.IOException
-
readBool
public boolean readBool() throws java.io.IOException- Throws:
java.io.IOException
-
readString
public java.lang.String readString() throws java.io.IOException- Throws:
java.io.IOException
-
readStringRequireUtf8
public java.lang.String readStringRequireUtf8() throws java.io.IOException- Throws:
java.io.IOException
-
readMessage
public <T> T readMessage(java.lang.Class<T> clazz, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
readMessageBySchemaWithCheck
public <T> T readMessageBySchemaWithCheck(Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
readGroup
@Deprecated public <T> T readGroup(java.lang.Class<T> clazz, ExtensionRegistryLite extensionRegistry) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
readGroupBySchemaWithCheck
@Deprecated public <T> T readGroupBySchemaWithCheck(Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
mergeMessageField
public <T> void mergeMessageField(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
mergeMessageFieldInternal
private <T> void mergeMessageFieldInternal(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
readMessage
private <T> T readMessage(Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
mergeGroupField
public <T> void mergeGroupField(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
mergeGroupFieldInternal
private <T> void mergeGroupFieldInternal(T target, Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
readGroup
private <T> T readGroup(Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
readBytes
public ByteString readBytes() throws java.io.IOException
- Throws:
java.io.IOException
-
readUInt32
public int readUInt32() throws java.io.IOException- Throws:
java.io.IOException
-
readEnum
public int readEnum() throws java.io.IOException- Throws:
java.io.IOException
-
readSFixed32
public int readSFixed32() throws java.io.IOException- Throws:
java.io.IOException
-
readSFixed64
public long readSFixed64() throws java.io.IOException- Throws:
java.io.IOException
-
readSInt32
public int readSInt32() throws java.io.IOException- Throws:
java.io.IOException
-
readSInt64
public long readSInt64() throws java.io.IOException- Throws:
java.io.IOException
-
readDoubleList
public void readDoubleList(java.util.List<java.lang.Double> target) throws java.io.IOException- Throws:
java.io.IOException
-
readFloatList
public void readFloatList(java.util.List<java.lang.Float> target) throws java.io.IOException- Throws:
java.io.IOException
-
readUInt64List
public void readUInt64List(java.util.List<java.lang.Long> target) throws java.io.IOException- Throws:
java.io.IOException
-
readInt64List
public void readInt64List(java.util.List<java.lang.Long> target) throws java.io.IOException- Throws:
java.io.IOException
-
readInt32List
public void readInt32List(java.util.List<java.lang.Integer> target) throws java.io.IOException- Throws:
java.io.IOException
-
readFixed64List
public void readFixed64List(java.util.List<java.lang.Long> target) throws java.io.IOException- Throws:
java.io.IOException
-
readFixed32List
public void readFixed32List(java.util.List<java.lang.Integer> target) throws java.io.IOException- Throws:
java.io.IOException
-
readBoolList
public void readBoolList(java.util.List<java.lang.Boolean> target) throws java.io.IOException- Throws:
java.io.IOException
-
readStringList
public void readStringList(java.util.List<java.lang.String> target) throws java.io.IOException- Throws:
java.io.IOException
-
readStringListRequireUtf8
public void readStringListRequireUtf8(java.util.List<java.lang.String> target) throws java.io.IOException- Throws:
java.io.IOException
-
readStringListInternal
public void readStringListInternal(java.util.List<java.lang.String> target, boolean requireUtf8) throws java.io.IOException- Throws:
java.io.IOException
-
readMessageList
public <T> void readMessageList(java.util.List<T> target, java.lang.Class<T> targetType, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
readMessageList
public <T> void readMessageList(java.util.List<T> target, Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
readGroupList
@Deprecated public <T> void readGroupList(java.util.List<T> target, java.lang.Class<T> targetType, ExtensionRegistryLite extensionRegistry) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
readGroupList
@Deprecated public <T> void readGroupList(java.util.List<T> target, Schema<T> schema, ExtensionRegistryLite extensionRegistry) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
readBytesList
public void readBytesList(java.util.List<ByteString> target) throws java.io.IOException
- Throws:
java.io.IOException
-
readUInt32List
public void readUInt32List(java.util.List<java.lang.Integer> target) throws java.io.IOException- Throws:
java.io.IOException
-
readEnumList
public void readEnumList(java.util.List<java.lang.Integer> target) throws java.io.IOException- Throws:
java.io.IOException
-
readSFixed32List
public void readSFixed32List(java.util.List<java.lang.Integer> target) throws java.io.IOException- Throws:
java.io.IOException
-
readSFixed64List
public void readSFixed64List(java.util.List<java.lang.Long> target) throws java.io.IOException- Throws:
java.io.IOException
-
readSInt32List
public void readSInt32List(java.util.List<java.lang.Integer> target) throws java.io.IOException- Throws:
java.io.IOException
-
readSInt64List
public void readSInt64List(java.util.List<java.lang.Long> target) throws java.io.IOException- Throws:
java.io.IOException
-
verifyPackedFixed64Length
private void verifyPackedFixed64Length(int bytes) throws java.io.IOException- Throws:
java.io.IOException
-
readMap
public <K,V> void readMap(java.util.Map<K,V> target, MapEntryLite.Metadata<K,V> metadata, ExtensionRegistryLite extensionRegistry) throws java.io.IOException- Throws:
java.io.IOException
-
readField
private java.lang.Object readField(WireFormat.FieldType fieldType, java.lang.Class<?> messageType, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
verifyPackedFixed32Length
private void verifyPackedFixed32Length(int bytes) throws java.io.IOException- Throws:
java.io.IOException
-
requirePosition
private void requirePosition(int expectedPosition) throws java.io.IOException- Throws:
java.io.IOException
-
-