Esempio n. 1
0
 public static void WriteValue <TValue>(this Stream stream, TValue value, int bufferSize = 655360)
 {
     using (var ebw = new ExaStreamWriter <TValue>(bufferSize))
     {
         ebw.Write(stream, value);
     }
 }
Esempio n. 2
0
 private static void ExaSerializer <T>(T[] values)
     where T : new()
 {
     using (var ms = new MemoryStream())
     {
         using (var bw = new ExaStreamWriter <T>())
         {
             foreach (var value in values)
             {
                 ms.Position = 0;
                 bw.Write(ms, value);
             }
         }
     }
 }
Esempio n. 3
0
        private static void ExaDeserializer <T>(T[] values)
            where T : new()
        {
            using (var ms = new MemoryStream())
            {
                using (var bw = new ExaStreamWriter <T>())
                {
                    bw.Write(ms, values[0]);
                }

                using (var br = new ExaStreamReader <T>())
                {
                    foreach (var value in values)
                    {
                        ms.Position = 0;
                        var retreive = br.Read(ms);
                    }
                }
            }
        }