Пример #1
0
 // Token: 0x06001023 RID: 4131 RVA: 0x00011DF8 File Offset: 0x0000FFF8
 public static void Serialize(Stream bytes, T[] instance, Action <Stream, T> serialization)
 {
     UShortProxy.Serialize(bytes, (ushort)instance.Length);
     foreach (T arg in instance)
     {
         serialization(bytes, arg);
     }
 }
Пример #2
0
 // Token: 0x0600108F RID: 4239 RVA: 0x00015308 File Offset: 0x00013508
 public static void Serialize(Stream bytes, ICollection <T> instance, ListProxy <T> .Serializer <T> serialization)
 {
     UShortProxy.Serialize(bytes, (ushort)instance.Count);
     foreach (T instance2 in instance)
     {
         serialization(bytes, instance2);
     }
 }
Пример #3
0
        // Token: 0x06001024 RID: 4132 RVA: 0x00011E38 File Offset: 0x00010038
        public static T[] Deserialize(Stream bytes, ArrayProxy <T> .Deserializer <T> serialization)
        {
            ushort num = UShortProxy.Deserialize(bytes);

            T[] array = new T[(int)num];
            for (int i = 0; i < (int)num; i++)
            {
                array[i] = serialization(bytes);
            }
            return(array);
        }
Пример #4
0
        // Token: 0x06001090 RID: 4240 RVA: 0x00015368 File Offset: 0x00013568
        public static List <T> Deserialize(Stream bytes, ListProxy <T> .Deserializer <T> serialization)
        {
            ushort   num  = UShortProxy.Deserialize(bytes);
            List <T> list = new List <T>((int)num);

            for (int i = 0; i < (int)num; i++)
            {
                list.Add(serialization(bytes));
            }
            return(list);
        }
Пример #5
0
        // Token: 0x060010A2 RID: 4258 RVA: 0x000155B8 File Offset: 0x000137B8
        public static string Deserialize(Stream bytes)
        {
            ushort num = UShortProxy.Deserialize(bytes);

            if (num > 0)
            {
                byte[] array = new byte[(int)(num * 2)];
                bytes.Read(array, 0, array.Length);
                return(Encoding.Unicode.GetString(array, 0, array.Length));
            }
            return(string.Empty);
        }
Пример #6
0
 // Token: 0x060010A1 RID: 4257 RVA: 0x00015570 File Offset: 0x00013770
 public static void Serialize(Stream bytes, string instance)
 {
     if (string.IsNullOrEmpty(instance))
     {
         UShortProxy.Serialize(bytes, 0);
     }
     else
     {
         UShortProxy.Serialize(bytes, (ushort)instance.Length);
         byte[] bytes2 = Encoding.Unicode.GetBytes(instance);
         bytes.Write(bytes2, 0, bytes2.Length);
     }
 }