class CompressedUInt64Serializer (Niantic.ARDK.Utilities.BinarySerialization.ItemSerializers.CompressedUInt64Serializer)

Overview

class CompressedUInt64Serializer: Niantic.ARDK.Utilities.BinarySerialization.ItemSerializers.BaseItemSerializer {
public:
    // fields

    static readonly CompressedUInt64Serializer Instance = new CompressedUInt64Serializer();

    // methods

    static UInt64 ReadCompressedUInt64(Stream stream);
    static void WriteCompressedUInt64(Stream stream, UInt64 value);
};

Inherited Members

public:
    // properties

    Type DataType;

    // methods

    object Deserialize(BinaryDeserializer deserializer);
    T Deserialize(BinaryDeserializer deserializer);
    void Serialize(BinarySerializer serializer, object item);
    void Serialize(BinarySerializer serializer, T item);
    T Deserialize(BinaryDeserializer deserializer);
    void Serialize(BinarySerializer serializer, T item);

Detailed Documentation

Methods

static void WriteCompressedUInt64(Stream stream, UInt64 value)

Writes an UInt64 value in “compressed” format. Assuming most values are small, we can possibly write a single byte instead of 8 if the value is smaller than 127. To do the “compression”, we write 7 bits of the value at a time, and use the last bit to tell if there’s more data or not. Unfortunately, in the worst case, we might end-up writing 10 bytes instead of 8.