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

Overview

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

    static readonly CompressedUInt32Serializer Instance = new CompressedUInt32Serializer();

    // methods

    static UInt32 ReadCompressedUInt32(Stream stream);
    static void WriteCompressedUInt32(Stream stream, UInt32 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 WriteCompressedUInt32(Stream stream, UInt32 value)

Writes an UInt32 value in "compressed" format. Assuming most values are small, we can possibly write a single byte instead of 4 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 5 bytes instead of 4.