Exemplo n.º 1
0
        // Token: 0x06000031 RID: 49 RVA: 0x00002BF0 File Offset: 0x00000DF0
        private void WriteInternal(Stream stream, byte nodeIndexSize, List <int> offsets, ArrayNode array)
        {
            byte[] array2   = new byte[(int)nodeIndexSize * array.Count];
            long   position = stream.Position;

            stream.Write(array2, 0, array2.Length);
            for (int i = 0; i < array.Count; i++)
            {
                BinaryFormatWriter.FormatIdx(this.WriteInternal(stream, nodeIndexSize, offsets, array[i]), nodeIndexSize).CopyTo(array2, (int)nodeIndexSize * i);
            }
            stream.Seek(position, SeekOrigin.Begin);
            stream.Write(array2, 0, array2.Length);
            stream.Seek(0L, SeekOrigin.End);
        }
Exemplo n.º 2
0
        // Token: 0x06000032 RID: 50 RVA: 0x00002C70 File Offset: 0x00000E70
        private void WriteInternal(Stream stream, byte nodeIndexSize, List <int> offsets, DictionaryNode dictionary)
        {
            byte[] array    = new byte[(int)nodeIndexSize * dictionary.Count];
            byte[] array2   = new byte[(int)nodeIndexSize * dictionary.Count];
            long   position = stream.Position;

            stream.Write(array, 0, array.Length);
            stream.Write(array2, 0, array2.Length);
            KeyValuePair <string, PNode>[] array3 = dictionary.ToArray <KeyValuePair <string, PNode> >();
            for (int i = 0; i < dictionary.Count; i++)
            {
                BinaryFormatWriter.FormatIdx(this.WriteInternal(stream, nodeIndexSize, offsets, NodeFactory.CreateKeyElement(array3[i].Key)), nodeIndexSize).CopyTo(array, (int)nodeIndexSize * i);
            }
            for (int j = 0; j < dictionary.Count; j++)
            {
                BinaryFormatWriter.FormatIdx(this.WriteInternal(stream, nodeIndexSize, offsets, array3[j].Value), nodeIndexSize).CopyTo(array2, (int)nodeIndexSize * j);
            }
            stream.Seek(position, SeekOrigin.Begin);
            stream.Write(array, 0, array.Length);
            stream.Write(array2, 0, array2.Length);
            stream.Seek(0L, SeekOrigin.End);
        }