Exemple #1
0
        public static T ReadFirst <T>(string fileName)
        {
            T first = default(T);

            using (var coder = new BinaryReadingCoder(fileName))
                coder.CodeT(ref first);
            return(first);
        }
Exemple #2
0
        public static T ReadFirst <T>(Stream stream)
        {
            T first = default(T);

            using (var coder = new BinaryReadingCoder(stream))
                coder.CodeT(ref first);
            return(first);
        }
Exemple #3
0
 public static T Decode <T>(this byte[] self)
 {
     using (var stream = new MemoryStream(self))
     {
         T result = default(T);
         using (var coder = new BinaryReadingCoder(stream)) coder.CodeT(ref result);
         return(result);
     }
 }