예제 #1
0
        public static T ReadFirst <T>(Stream stream)
        {
            T first = default(T);

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

            using (var coder = new BinaryReadingCoder(fileName))
                coder.CodeT(ref first);
            return(first);
        }
예제 #3
0
        public static object ReadFirstObject(string fileName)
        {
            object first = null;

            using (var coder = new BinaryReadingCoder(fileName))
                coder.Code(ref first);
            return(first);
        }
예제 #4
0
        public static object ReadFirstObject(Stream stream)
        {
            object first = null;

            using (var coder = new BinaryReadingCoder(stream))
                coder.Code(ref first);
            return(first);
        }
예제 #5
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);
     }
 }