public sealed class UnknownFieldSet : object
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.
Namespace
Google.ProtobufAssembly
Google.Protobuf.dll
Methods
CalculateSize()
public int CalculateSize()
Gets the number of bytes required to encode this set.
Returns | |
---|---|
Type | Description |
Int32 |
Clone(UnknownFieldSet)
public static UnknownFieldSet Clone(UnknownFieldSet other)
Clone an unknown field set from other
.
Parameter | |
---|---|
Name | Description |
other | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
UnknownFieldSet |
Equals(Object)
public override bool Equals(object other)
Checks if two unknown field sets are equal.
Parameter | |
---|---|
Name | Description |
other | Object |
Returns | |
---|---|
Type | Description |
Boolean |
GetHashCode()
public override int GetHashCode()
Gets the unknown field set's hash code.
Returns | |
---|---|
Type | Description |
Int32 |
MergeFieldFrom(UnknownFieldSet, CodedInputStream)
public static UnknownFieldSet MergeFieldFrom(UnknownFieldSet unknownFields, CodedInputStream input)
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.
Parameters | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet The UnknownFieldSet which need to be merged |
input | CodedInputStream The coded input stream containing the field |
Returns | |
---|---|
Type | Description |
UnknownFieldSet | The merged UnknownFieldSet |
MergeFieldFrom(UnknownFieldSet, ref ParseContext)
public static UnknownFieldSet MergeFieldFrom(UnknownFieldSet unknownFields, ref ParseContext ctx)
Create a new UnknownFieldSet if unknownFields is null.
Parse a single field from ctx
and merge it
into unknownFields. If ctx
is configured to discard unknown fields,
unknownFields
will be returned as-is and the field will be skipped.
Parameters | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet The UnknownFieldSet which need to be merged |
ctx | ParseContext The parse context from which to read the field |
Returns | |
---|---|
Type | Description |
UnknownFieldSet | The merged UnknownFieldSet |
MergeFrom(UnknownFieldSet, UnknownFieldSet)
public static UnknownFieldSet MergeFrom(UnknownFieldSet unknownFields, UnknownFieldSet other)
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.
Parameters | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
other | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
UnknownFieldSet |
WriteTo(CodedOutputStream)
public void WriteTo(CodedOutputStream output)
Serializes the set and writes it to output
.
Parameter | |
---|---|
Name | Description |
output | CodedOutputStream |
WriteTo(ref WriteContext)
public void WriteTo(ref WriteContext ctx)
Serializes the set and writes it to ctx
.
Parameter | |
---|---|
Name | Description |
ctx | WriteContext |