/// <summary>
        ///
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        public object ReadObject(Stream stream)
        {
            if (null == stream)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            var scheme = HessianSerializationScheme.CreateFromType(type);

            using (var reader = new HessianInputReader(stream))
            {
                var context = new HessianSerializationContext();
                return(scheme.Deserialize(reader, context));
            }
        }
        /// <summary>
        /// Serializes a specified object to binary data and writes the resulting to a stream.
        /// </summary>
        /// <param name="stream">The <see cref="System.IO.Stream" /> that is written to.</param>
        /// <param name="graph">The object that contains the data to write to the stream.</param>
        public void WriteObject(Stream stream, object graph)
        {
            if (null == stream)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            var scheme = HessianSerializationScheme.CreateFromType(type);

            using (var writer = new HessianOutputWriter(stream))
            {
                var context = new HessianSerializationContext();
                scheme.Serialize(writer, graph, context);
            }
        }