Namespace Google.Protobuf (3.27.1)

Classes

ByteString

Immutable array of bytes.

CodedInputStream

Reads and decodes protocol message fields.

CodedOutputStream

Encodes and writes protocol message fields.

CodedOutputStream.OutOfSpaceException

Indicates that a CodedOutputStream wrapping a flat byte arrayran out of space.

Extension

Represents a non-generic extension definition. This API is experimental and subject to change.

ExtensionRegistry

Provides extensions to messages while parsing. This API is experimental and subject to change.

ExtensionSet

Methods for managingExtensionSet<TTarget>s with null checking.

Most users will not use this class directly and its API is experimental and subject to change.

ExtensionSet<TTarget>

Used for keeping track of extensions in messages.IExtendableMessage<T> methods route to this set.

Most users will not need to use this class directly

Extension<TTarget, TValue>

Represents a type-safe extension identifier used for getting and setting single extension values inIExtendableMessage<T> instances. This API is experimental and subject to change.

FieldCodec

Factory methods forFieldCodec<T>.

FieldCodec<T>

An encode/decode pair for a single field. This effectively encapsulatesall the information needed to read or write the field value from/to a codedstream.

This class is public and has to be as it is used by generated code, but its publicAPI is very limited - just what the generated code needs to call directly.

InvalidJsonException

Thrown when an attempt is made to parse invalid JSON, e.g. usinga non-string property key, or including a redundant comma. Parsing a protocol buffermessage represented in JSON usingJsonParser can throw both thisexception andInvalidProtocolBufferException depending on the situation. Thisexception is only thrown for "pure JSON" errors, whereasInvalidProtocolBufferExceptionis thrown when the JSON may be valid in and of itself, but cannot be parsed as a protocol buffermessage.

InvalidProtocolBufferException

Thrown when a protocol message being parsed is invalid in some way,e.g. it contains a malformed varint or a negative byte length.

JsonFormatter

Reflection-based converter from messages to JSON.

JsonFormatter.Settings

Settings controlling JSON formatting.

JsonParser

Reflection-based converter from JSON to messages.

JsonParser.Settings

Settings controlling JSON parsing.

MessageExtensions

Extension methods onIMessage andIMessage<T>.

MessageParser

A general message parser, typically used by reflection-based code as all the methodsreturn simpleIMessage.

MessageParser<T>

A parser for a specific message type.

ProtoPreconditions

Helper methods for throwing exceptions when preconditions are not met.

RepeatedExtension<TTarget, TValue>

Represents a type-safe extension identifier used for getting repeated extension values inIExtendableMessage<T> instances.This API is experimental and subject to change.

UnknownFieldSet

Used to keep track of fields which were seen when parsing a protocol messagebut whose field numbers or types are unrecognized. This most frequentlyoccurs when new fields are added to a message type and then messages containingthose fields are read by old software that was built before the new types wereadded.

Most users will never need to use this class directly.

UnsafeByteOperations

Provides a number of unsafe byte operations to be used by advanced applications with high performancerequirements. These methods are referred to as "unsafe" due to the fact that they potentially exposethe backing buffer of aByteString to the application.

WireFormat

This class is used internally by the Protocol Buffer Library and generatedmessage implementations. It is public only for the sake of those generatedmessages. Others should not use this class directly.

This class contains constants and helper functions useful for dealing withthe Protocol Buffer wire format.

Structs

ParseContext

An opaque struct that represents the current parsing state and is passed alongas the parsing proceeds.All the public methods are intended to be invoked only by the generated code,users should never invoke them directly.

WriteContext

An opaque struct that represents the current serialization state and is passed alongas the serialization proceeds.All the public methods are intended to be invoked only by the generated code,users should never invoke them directly.

Interfaces

IBufferMessage

Interface for a Protocol Buffers message, supportingparsing fromParseContext and writing toWriteContext.

ICustomDiagnosticMessage

A message type that has a custom string format for diagnostic purposes.

IDeepCloneable<T>

Generic interface for a deeply cloneable type.

IExtendableMessage<T>

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.

IMessage

Interface for a Protocol Buffers message, supportingbasic operations required for serialization.

IMessage<T>

Generic interface for a Protocol Buffers message,where the type parameter is expected to be the same type asthe implementation class.

Enums

WireFormat.WireType

Wire types within protobuf encoding.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.