# Class WireFormat (3.27.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.27.1 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormat)
- [3.23.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.WireFormat)
- [3.15.8](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.WireFormat)

    public static class WireFormat

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.

<br />

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> WireFormat

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Protobuf](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf)

## Assembly

Google.Protobuf.dll

## Methods

### GetTagFieldNumber(uint)

    public static int GetTagFieldNumber(uint tag)

Given a tag value, determines the field number (the upper 29 bits).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### GetTagWireType(uint)

    public static WireFormat.WireType GetTagWireType(uint tag)

Given a tag value, determines the wire type (lower 3 bits).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormathttps://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormat.WireType` |   |

### MakeTag(int, WireType)

    public static uint MakeTag(int fieldNumber, WireFormat.WireType wireType)

Makes a tag value given a field number and wire type.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldNumber` | `https://learn.microsoft.com/dotnet/api/system.int32` |
| `wireType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormathttps://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WireFormat.WireType` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.uint32` |   |