Ejemplo n.º 1
0
        public static ObjectKeyList FromReader(BinaryReader reader, byte version)
        {
            var keys  = new Dictionary <string, ObjectKey>();
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var key = new ObjectKey();
                key.Read(reader, true);
                keys.Add(key.Name, key);
            }
            return(new ObjectKeyList(keys));
        }
Ejemplo n.º 2
0
 internal ObjectKey ReadKey(long position, int length)
 {
     lock (Sync)
     {
         var buffer = new byte[length];
         ReadBuffer(buffer, position, buffer.Length);
         var key = new ObjectKey(this, null, null);
         using (var ms = new MemoryStream(buffer))
             using (var rdr = new BinaryReader(ms))
                 key.Read(rdr, true);
         key.position = position;
         return(key);
     }
 }