Represents a type-safe extension identifier used for getting and setting single extension values in IExtendableMessage<T> instances.
This API is experimental and subject to change.
An encode/decode pair for a single field. This effectively encapsulates
all the information needed to read or write the field value from/to a coded
stream.
This class is public and has to be as it is used by generated code, but its public
API is very limited - just what the generated code needs to call directly.
Thrown when an attempt is made to parse invalid JSON, e.g. using
a non-string property key, or including a redundant comma. Parsing a protocol buffer
message represented in JSON using JsonParser can throw both this
exception and InvalidProtocolBufferException depending on the situation. This
exception is only thrown for "pure JSON" errors, whereas InvalidProtocolBufferException
is thrown when the JSON may be valid in and of itself, but cannot be parsed as a protocol buffer
message.
Represents a type-safe extension identifier used for getting repeated extension values in IExtendableMessage<T> instances.
This API is experimental and subject to change.
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.
Provides a number of unsafe byte operations to be used by advanced applications with high performance
requirements. These methods are referred to as "unsafe" due to the fact that they potentially expose
the backing buffer of a ByteString to the application.
This class is used internally by the Protocol Buffer Library and generated
message implementations. It is public only for the sake of those generated
messages. Others should not use this class directly.
This class contains constants and helper functions useful for dealing with
the Protocol Buffer wire format.
An opaque struct that represents the current parsing state and is passed along
as the parsing proceeds.
All the public methods are intended to be invoked only by the generated code,
users should never invoke them directly.
An opaque struct that represents the current serialization state and is passed along
as the serialization proceeds.
All the public methods are intended to be invoked only by the generated code,
users should never invoke them directly.
Generic interface for a Protocol Buffers message containing one or more extensions, where the type parameter is expected to be the same type as the implementation class.
This interface is experiemental and is subject to change.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe latest version of Google.Protobuf is 3.27.1, with older versions 3.23.0 and 3.15.8 also available.\u003c/p\u003e\n"],["\u003cp\u003eThe library includes classes for handling byte arrays, encoding/decoding, and managing protocol message fields, such as \u003ccode\u003eByteString\u003c/code\u003e, \u003ccode\u003eCodedInputStream\u003c/code\u003e, and \u003ccode\u003eCodedOutputStream\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSeveral classes like \u003ccode\u003eExtension\u003c/code\u003e, \u003ccode\u003eExtensionRegistry\u003c/code\u003e, \u003ccode\u003eExtensionSet\u003c/code\u003e, \u003ccode\u003eExtension<TTarget, TValue>\u003c/code\u003e, and \u003ccode\u003eRepeatedExtension<TTarget, TValue>\u003c/code\u003e are provided to manage extensions, but are marked as experimental and may change.\u003c/p\u003e\n"],["\u003cp\u003eThe library offers classes for converting messages to and from JSON format (\u003ccode\u003eJsonFormatter\u003c/code\u003e, \u003ccode\u003eJsonParser\u003c/code\u003e) and also includes classes to handle exceptions that may arise during parsing (\u003ccode\u003eInvalidJsonException\u003c/code\u003e, \u003ccode\u003eInvalidProtocolBufferException\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eParseContext\u003c/code\u003e and \u003ccode\u003eWriteContext\u003c/code\u003e structs are present for parsing and serialization state, but they should only be used by generated code, not directly by users.\u003c/p\u003e\n"]]],[],null,["# Namespace Google.Protobuf (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf) \n\nClasses\n-------\n\n### [ByteString](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString)\n\nImmutable array of bytes.\n\n### [CodedInputStream](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedInputStream)\n\nReads and decodes protocol message fields.\n\n### [CodedOutputStream](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedOutputStream)\n\nEncodes and writes protocol message fields.\n\n### [CodedOutputStream.OutOfSpaceException](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedOutputStream.OutOfSpaceException)\n\nIndicates that a CodedOutputStream wrapping a flat byte array\nran out of space.\n\n### [Extension](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Extension)\n\nRepresents a non-generic extension definition. This API is experimental and subject to change.\n\n### [ExtensionRegistry](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ExtensionRegistry)\n\nProvides extensions to messages while parsing. This API is experimental and subject to change.\n\n### [ExtensionSet](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ExtensionSet)\n\nMethods for managing [ExtensionSet\\\u003cTTarget\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ExtensionSet-1)s with null checking.\n\nMost users will not use this class directly and its API is experimental and subject to change.\n\n### [ExtensionSet\\\u003cTTarget\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ExtensionSet-1)\n\nUsed for keeping track of extensions in messages.\n[IExtendableMessage\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IExtendableMessage-1) methods route to this set.\n\nMost users will not need to use this class directly\n\n### [Extension\\\u003cTTarget, TValue\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Extension-2)\n\nRepresents a type-safe extension identifier used for getting and setting single extension values in [IExtendableMessage\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IExtendableMessage-1) instances.\nThis API is experimental and subject to change.\n\n### [FieldCodec](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec)\n\nFactory methods for [FieldCodec\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1).\n\n### [FieldCodec\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1)\n\n\nAn encode/decode pair for a single field. This effectively encapsulates\nall the information needed to read or write the field value from/to a coded\nstream.\n\n\nThis class is public and has to be as it is used by generated code, but its public\nAPI is very limited - just what the generated code needs to call directly.\n\n### [InvalidJsonException](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.InvalidJsonException)\n\nThrown when an attempt is made to parse invalid JSON, e.g. using\na non-string property key, or including a redundant comma. Parsing a protocol buffer\nmessage represented in JSON using [JsonParser](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.JsonParser) can throw both this\nexception and [InvalidProtocolBufferException](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.InvalidProtocolBufferException) depending on the situation. This\nexception is only thrown for \"pure JSON\" errors, whereas `InvalidProtocolBufferException`\nis thrown when the JSON may be valid in and of itself, but cannot be parsed as a protocol buffer\nmessage.\n\n### [InvalidProtocolBufferException](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.InvalidProtocolBufferException)\n\nThrown when a protocol message being parsed is invalid in some way,\ne.g. it contains a malformed varint or a negative byte length.\n\n### [JsonFormatter](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.JsonFormatter)\n\nReflection-based converter from messages to JSON.\n\n### [JsonFormatter.Settings](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.JsonFormatter.Settings)\n\nSettings controlling JSON formatting.\n\n### [JsonParser](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.JsonParser)\n\nReflection-based converter from JSON to messages.\n\n### [JsonParser.Settings](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.JsonParser.Settings)\n\nSettings controlling JSON parsing.\n\n### [MessageExtensions](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions)\n\nExtension methods on [IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage) and [IMessage\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1).\n\n### [MessageParser](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageParser)\n\nA general message parser, typically used by reflection-based code as all the methods\nreturn simple [IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage).\n\n### [MessageParser\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageParser-1)\n\nA parser for a specific message type.\n\n### [ProtoPreconditions](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ProtoPreconditions)\n\nHelper methods for throwing exceptions when preconditions are not met.\n\n### [RepeatedExtension\\\u003cTTarget, TValue\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.RepeatedExtension-2)\n\nRepresents a type-safe extension identifier used for getting repeated extension values in [IExtendableMessage\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IExtendableMessage-1) instances.\nThis API is experimental and subject to change.\n\n### [UnknownFieldSet](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.UnknownFieldSet)\n\nUsed to keep track of fields which were seen when parsing a protocol message\nbut whose field numbers or types are unrecognized. This most frequently\noccurs when new fields are added to a message type and then messages containing\nthose fields are read by old software that was built before the new types were\nadded.\n\nMost users will never need to use this class directly.\n\n### [UnsafeByteOperations](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.UnsafeByteOperations)\n\nProvides a number of unsafe byte operations to be used by advanced applications with high performance\nrequirements. These methods are referred to as \"unsafe\" due to the fact that they potentially expose\nthe backing buffer of a [ByteString](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString) to the application.\n\n### [WireFormat](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormat)\n\nThis class is used internally by the Protocol Buffer Library and generated\nmessage implementations. It is public only for the sake of those generated\nmessages. Others should not use this class directly.\n\n\nThis class contains constants and helper functions useful for dealing with\nthe Protocol Buffer wire format.\n\n\u003cbr /\u003e\n\nStructs\n-------\n\n### [ParseContext](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ParseContext)\n\nAn opaque struct that represents the current parsing state and is passed along\nas the parsing proceeds.\nAll the public methods are intended to be invoked only by the generated code,\nusers should never invoke them directly.\n\n### [WriteContext](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WriteContext)\n\nAn opaque struct that represents the current serialization state and is passed along\nas the serialization proceeds.\nAll the public methods are intended to be invoked only by the generated code,\nusers should never invoke them directly.\n\nInterfaces\n----------\n\n### [IBufferMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage)\n\nInterface for a Protocol Buffers message, supporting\nparsing from [ParseContext](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ParseContext) and writing to [WriteContext](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WriteContext).\n\n### [ICustomDiagnosticMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ICustomDiagnosticMessage)\n\nA message type that has a custom string format for diagnostic purposes.\n\n### [IDeepCloneable\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1)\n\nGeneric interface for a deeply cloneable type.\n\n### [IExtendableMessage\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IExtendableMessage-1)\n\nGeneric interface for a Protocol Buffers message containing one or more extensions, where the type parameter is expected to be the same type as the implementation class.\nThis interface is experiemental and is subject to change.\n\n### [IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage)\n\nInterface for a Protocol Buffers message, supporting\nbasic operations required for serialization.\n\n### [IMessage\\\u003cT\\\u003e](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1)\n\nGeneric interface for a Protocol Buffers message,\nwhere the type parameter is expected to be the same type as\nthe implementation class.\n\nEnums\n-----\n\n### [WireFormat.WireType](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormat.WireType)\n\nWire types within protobuf encoding."]]