Język

ProtoOutputStream.MakeToken(Int32, Boolean, Int32, Int32, Int32) Method

Definition

Make a token.

[Android.Runtime.Register("makeToken", "(IZIII)J", "", ApiSince=30)]
public static long MakeToken(int tagSize, bool repeated, int depth, int objectId, int offset);
[<Android.Runtime.Register("makeToken", "(IZIII)J", "", ApiSince=30)>]
static member MakeToken : int * bool * int * int * int -> int64

Parameters

tagSize
Int32

The encoded field tag size, in bytes. Only the low 3 bits are stored.

repeated
Boolean

Whether the object is a repeated field.

depth
Int32

The object nesting depth. Only the low 9 bits are stored.

objectId
Int32

The object identifier used for error checking. Only the low 19 bits are stored.

offset
Int32

The buffer offset associated with the object. All 32 bits are stored.

Returns

A 64-bit token containing the masked tag size, repeated flag, masked depth, masked object identifier, and offset.

Attributes

Remarks

Bits 61 through 63 contain the tag size; bit 60 contains the repeated flag; bits 51 through 59 contain the depth; bits 32 through 50 contain the object identifier; and bits 0 through 31 contain the offset. Bit 0 is the least significant bit.

The depth and object identifier are masked to 9 and 19 bits, respectively. Their stored values range from 0 through 511 and from 0 through 524287. Higher bits are discarded; this method does not validate the supplied values.

These fields describe an internal object token, not a protobuf field tag. Use the token returned by Start(Int64) with End(Int64) when writing nested messages.

Applies to