Class UnknownFieldSet
Used to keep track of fields which were seen when parsing a protocol message but whose field numbers or types are unrecognized. This most frequently occurs when new fields are added to a message type and then messages containing those fields are read by old software that was built before the new types were added.
Most users will never need to use this class directly.
Inheritance
Inherited Members
Namespace: Google.Protobuf
Assembly: Google.Protobuf.dll
Syntax
public sealed class UnknownFieldSet
Methods
CalculateSize()
Gets the number of bytes required to encode this set.
Declaration
public int CalculateSize()
Returns
Type | Description |
---|---|
System.Int32 |
Clone(UnknownFieldSet)
Clone an unknown field set from other
.
Declaration
public static UnknownFieldSet Clone(UnknownFieldSet other)
Parameters
Type | Name | Description |
---|---|---|
UnknownFieldSet | other |
Returns
Type | Description |
---|---|
UnknownFieldSet |
Equals(Object)
Checks if two unknown field sets are equal.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Gets the unknown field set's hash code.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
MergeFieldFrom(UnknownFieldSet, CodedInputStream)
Create a new UnknownFieldSet if unknownFields is null.
Parse a single field from input
and merge it
into unknownFields. If input
is configured to discard unknown fields,
unknownFields
will be returned as-is and the field will be skipped.
Declaration
public static UnknownFieldSet MergeFieldFrom(UnknownFieldSet unknownFields, CodedInputStream input)
Parameters
Type | Name | Description |
---|---|---|
UnknownFieldSet | unknownFields | The UnknownFieldSet which need to be merged |
CodedInputStream | input | The coded input stream containing the field |
Returns
Type | Description |
---|---|
UnknownFieldSet | The merged UnknownFieldSet |
MergeFrom(UnknownFieldSet, UnknownFieldSet)
Created a new UnknownFieldSet to unknownFields
if
needed and merges the fields from other
into the first set.
If a field number exists in both sets, the values in other
will be appended to the values in this set.
Declaration
public static UnknownFieldSet MergeFrom(UnknownFieldSet unknownFields, UnknownFieldSet other)
Parameters
Type | Name | Description |
---|---|---|
UnknownFieldSet | unknownFields | |
UnknownFieldSet | other |
Returns
Type | Description |
---|---|
UnknownFieldSet |
WriteTo(CodedOutputStream)
Serializes the set and writes it to output
.
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type | Name | Description |
---|---|---|
CodedOutputStream | output |