docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BitCounter

    Utility class to count the number of bytes or bits needed to serialize a value.

    Inheritance
    object
    BitCounter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Netcode
    Assembly: Unity.Netcode.Runtime.dll
    Syntax
    public static class BitCounter

    Methods

    GetUsedBitCount(uint)

    Get the minimum number of bits required to represent the given value

    Declaration
    public static int GetUsedBitCount(uint value)
    Parameters
    Type Name Description
    uint value

    The value

    Returns
    Type Description
    int

    The number of bits required

    GetUsedBitCount(ulong)

    Get the minimum number of bits required to represent the given value

    Declaration
    public static int GetUsedBitCount(ulong value)
    Parameters
    Type Name Description
    ulong value

    The value

    Returns
    Type Description
    int

    The number of bits required

    GetUsedByteCount(uint)

    Get the minimum number of bytes required to represent the given value

    Declaration
    public static int GetUsedByteCount(uint value)
    Parameters
    Type Name Description
    uint value

    The value

    Returns
    Type Description
    int

    The number of bytes required

    GetUsedByteCount(ulong)

    Get the minimum number of bytes required to represent the given value

    Declaration
    public static int GetUsedByteCount(ulong value)
    Parameters
    Type Name Description
    ulong value

    The value

    Returns
    Type Description
    int

    The number of bytes required

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)