public static void WriteValue <TValue>(this Stream stream, TValue value, int bufferSize = 655360) { using (var ebw = new ExaStreamWriter <TValue>(bufferSize)) { ebw.Write(stream, value); } }
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); } } } }
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); } } } }