Show / Hide Table of Contents

Interface IMessage

Interface for a Protocol Buffers message, supporting basic operations required for serialization.

Namespace: Google.Protobuf
Assembly: Google.Protobuf.dll
Syntax
public interface IMessage

Properties

Descriptor

Descriptor for this message. All instances are expected to return the same descriptor, and for generated types this will be an explicitly-implemented member, returning the same value as the static property declared on the type.

Declaration
MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Methods

CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

Declaration
int CalculateSize()
Returns
Type Description
System.Int32

The number of bytes required to write this message to a coded output stream.

MergeFrom(CodedInputStream)

Merges the data from the specified coded input stream with the current message.

Declaration
void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Remarks

See the user guide for precise merge semantics.

WriteTo(CodedOutputStream)

Writes the data to the given coded output stream.

Declaration
void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output

Coded output stream to write the data to. Must not be null.

Extension Methods

MessageExtensions.MergeFrom(IMessage, Byte[])
MessageExtensions.MergeFrom(IMessage, Byte[], Int32, Int32)
MessageExtensions.MergeFrom(IMessage, ByteString)
MessageExtensions.MergeFrom(IMessage, Stream)
MessageExtensions.MergeDelimitedFrom(IMessage, Stream)
MessageExtensions.ToByteArray(IMessage)
MessageExtensions.WriteTo(IMessage, Stream)
MessageExtensions.WriteDelimitedTo(IMessage, Stream)
MessageExtensions.ToByteString(IMessage)
MessageExtensions.IsInitialized(IMessage)
Back to top