コード例 #1
0
        public static T Deserialize <T> (Stream stream, IBinaryReaderSurrogate?surrogate = default)
        {
            using var reader = new StreamBinaryReader(stream, surrogate);

            return((T)reader.Read(typeof(T)) !);
        }
コード例 #2
0
        public static object?Deserialize(Stream stream, Type type, IBinaryReaderSurrogate?surrogate = default)
        {
            using var reader = new StreamBinaryReader(stream, surrogate);

            return(reader.Read(type));
        }