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.
[[["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-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eWriteContext\u003c/code\u003e struct represents the current serialization state in the Google.Protobuf library and is primarily intended for internal use by generated code.\u003c/p\u003e\n"],["\u003cp\u003eThis struct contains methods for writing various data types, such as bool, bytes, double, int, string, and others, without field tags.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eWriteContext\u003c/code\u003e includes methods for writing encoded tags, either single-byte or multiple-byte, allowing for flexible tag encoding.\u003c/p\u003e\n"],["\u003cp\u003eThe class has methods to write specific messages and groups to the stream, with length prefixing for accurate data delimitation.\u003c/p\u003e\n"],["\u003cp\u003eThis struct inherits some functionality from \u003ccode\u003eValueType\u003c/code\u003e and \u003ccode\u003eobject\u003c/code\u003e, including methods like \u003ccode\u003eEquals\u003c/code\u003e, \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eToString\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e, and \u003ccode\u003eReferenceEquals\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Struct WriteContext (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WriteContext)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.WriteContext)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.WriteContext) \n\n public ref struct 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\nInherited Members\n-----------------\n\n[ValueType.Equals(object)](https://learn.microsoft.com/dotnet/api/system.valuetype.equals) \n[ValueType.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode) \n[ValueType.ToString()](https://learn.microsoft.com/dotnet/api/system.valuetype.tostring) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Protobuf](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf)\n\nAssembly\n--------\n\nGoogle.Protobuf.dll\n\nMethods\n-------\n\n### WriteBool(bool)\n\n public void WriteBool(bool value)\n\nWrites a bool field value, without a tag.\n\n### WriteBytes(ByteString)\n\n public void WriteBytes(ByteString value)\n\nWrite a byte string, without a tag, to the stream.\nThe data is length-prefixed.\n\n### WriteDouble(double)\n\n public void WriteDouble(double value)\n\nWrites a double field value, without a tag.\n\n### WriteEnum(int)\n\n public void WriteEnum(int value)\n\nWrites an enum value, without a tag.\n\n### WriteFixed32(uint)\n\n public void WriteFixed32(uint value)\n\nWrites a fixed32 field value, without a tag.\n\n### WriteFixed64(ulong)\n\n public void WriteFixed64(ulong value)\n\nWrites a fixed64 field value, without a tag.\n\n### WriteFloat(float)\n\n public void WriteFloat(float value)\n\nWrites a float field value, without a tag.\n\n### WriteGroup(IMessage)\n\n public void WriteGroup(IMessage value)\n\nWrites a group, without a tag, to the stream.\n\n### WriteInt32(int)\n\n public void WriteInt32(int value)\n\nWrites an int32 field value, without a tag.\n\n### WriteInt64(long)\n\n public void WriteInt64(long value)\n\nWrites an int64 field value, without a tag.\n\n### WriteLength(int)\n\n public void WriteLength(int length)\n\nWrites a length (in bytes) for length-delimited data.\n\n**Remarks** \nThis method simply writes a rawint, but exists for clarity in calling code.\n\n### WriteMessage(IMessage)\n\n public void WriteMessage(IMessage value)\n\nWrites a message, without a tag.\nThe data is length-prefixed.\n\n### WriteRawTag(byte)\n\n public void WriteRawTag(byte b1)\n\nWrites the given single-byte tag.\n\n### WriteRawTag(byte, byte)\n\n public void WriteRawTag(byte b1, byte b2)\n\nWrites the given two-byte tag.\n\n### WriteRawTag(byte, byte, byte)\n\n public void WriteRawTag(byte b1, byte b2, byte b3)\n\nWrites the given three-byte tag.\n\n### WriteRawTag(byte, byte, byte, byte)\n\n public void WriteRawTag(byte b1, byte b2, byte b3, byte b4)\n\nWrites the given four-byte tag.\n\n### WriteRawTag(byte, byte, byte, byte, byte)\n\n public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5)\n\nWrites the given five-byte tag.\n\n### WriteSFixed32(int)\n\n public void WriteSFixed32(int value)\n\nWrites an sfixed32 value, without a tag.\n\n### WriteSFixed64(long)\n\n public void WriteSFixed64(long value)\n\nWrites an sfixed64 value, without a tag.\n\n### WriteSInt32(int)\n\n public void WriteSInt32(int value)\n\nWrites an sint32 value, without a tag.\n\n### WriteSInt64(long)\n\n public void WriteSInt64(long value)\n\nWrites an sint64 value, without a tag.\n\n### WriteString(string)\n\n public void WriteString(string value)\n\nWrites a string field value, without a tag.\nThe data is length-prefixed.\n\n### WriteTag(int, WireType)\n\n public void WriteTag(int fieldNumber, WireFormat.WireType type)\n\nEncodes and writes a tag.\n\n### WriteTag(uint)\n\n public void WriteTag(uint tag)\n\nWrites an already-encoded tag.\n\n### WriteUInt32(uint)\n\n public void WriteUInt32(uint value)\n\nWrites a uint32 value, without a tag.\n\n### WriteUInt64(ulong)\n\n public void WriteUInt64(ulong value)\n\nWrites a uint64 field value, without a tag."]]