public static void Read(this IDictionary <uint, string> _this, EndianStream stream) { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { uint key = stream.ReadUInt32(); string value = stream.ReadStringAligned(); _this.Add(key, value); } }
public static KeyValuePair <int, uint>[] ReadInt32KVPUInt32Array(this EndianStream stream) { int count = stream.ReadInt32(); KeyValuePair <int, uint>[] array = new KeyValuePair <int, uint> [count]; for (int i = 0; i < count; i++) { int key = stream.ReadInt32(); uint value = stream.ReadUInt32(); KeyValuePair <int, uint> kvp = new KeyValuePair <int, uint>(key, value); array[i] = kvp; } return(array); }