/// <inheritdoc />
        public override object Deserialize(byte[] serializedBytes, Type type)
        {
            new { type }.Must().NotBeNull();

            this.InternalBsonThrowOnUnregisteredTypeIfAppropriate(type);

            if (serializedBytes == null)
            {
                return(null);
            }

            return(NaosBsonSerializerHelper.Deserialize(serializedBytes, type));
        }
        /// <inheritdoc />
        public override T Deserialize <T>(byte[] serializedBytes)
        {
            var objectType = typeof(T);

            this.InternalBsonThrowOnUnregisteredTypeIfAppropriate(objectType);

            if (serializedBytes == null)
            {
                return(default(T));
            }

            return(NaosBsonSerializerHelper.Deserialize <T>(serializedBytes));
        }