Exemple #1
0
 /// <summary>
 /// 字符数组序列化
 /// </summary>
 /// <param name="stream">序列化数据流</param>
 /// <param name="array">数据,不能为null</param>
 internal static void Serialize(UnmanagedStream stream, byte[][] array)
 {
     AutoCSer.BinarySerialize.SerializeArrayMap arrayMap = new AutoCSer.BinarySerialize.SerializeArrayMap(stream, array.Length, 0);
     foreach (byte[] value in array)
     {
         arrayMap.Next(value != null);
     }
     arrayMap.End(stream);
     foreach (byte[] value in array)
     {
         if (value != null)
         {
             AutoCSer.BinarySerialize.Serializer.Serialize(stream, value);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// 二进制数组序列化
 /// </summary>
 /// <param name="stream">序列化数据流</param>
 /// <param name="array">数据,不能为null</param>
 internal static void Serialize(UnmanagedStream stream, Cache.Value.Binary[] array)
 {
     AutoCSer.BinarySerialize.SerializeArrayMap arrayMap = new AutoCSer.BinarySerialize.SerializeArrayMap(stream, array.Length, 0);
     foreach (Cache.Value.Binary value in array)
     {
         arrayMap.Next(value.Data != null);
     }
     arrayMap.End(stream);
     foreach (Cache.Value.Binary value in array)
     {
         if (value.Data != null)
         {
             AutoCSer.BinarySerialize.Serializer.Serialize(stream, value.Data);
         }
     }
 }
Exemple #3
0
 /// <summary>
 /// 字符串序列化
 /// </summary>
 /// <param name="stream">序列化数据流</param>
 /// <param name="array">数据,不能为null</param>
 internal static void Serialize(UnmanagedStream stream, string[] array)
 {
     AutoCSer.BinarySerialize.SerializeArrayMap arrayMap = new AutoCSer.BinarySerialize.SerializeArrayMap(stream, array.Length, 0);
     foreach (string value in array)
     {
         arrayMap.Next(value != null);
     }
     arrayMap.End(stream);
     foreach (string value in array)
     {
         if (value != null)
         {
             if (value.Length == 0)
             {
                 stream.Write(0);
             }
             else
             {
                 fixed(char *valueFixed = value) AutoCSer.BinarySerialize.Serializer.Serialize(valueFixed, stream, value.Length);
             }
         }
     }
 }