/// <summary>
        /// Constructs a BlobSignatureItem object with the specified parameters.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="contentType"></param>
        /// <param name="hashInfo"></param>
        /// 
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="name"/> or <paramref name="contentType"/> are <b>null</b>.
        /// </exception>
        internal BlobSignatureItem(string name, string contentType, BlobHashInfo hashInfo)
        {
            Validator.ThrowIfArgumentNull(name, "name", "ArgumentNull");
            Validator.ThrowIfArgumentNull(contentType, "contentType", "ArgumentNull");

            _name = name;
            _contentType = contentType;
            _hashInfo = hashInfo;
        }
        /// <summary>
        /// Constructs an instance of the Blob class with the specified values.
        /// </summary>
        /// 
        /// <param name="name">
        /// The name of the BLOB. It can be <see cref="String.Empty"/> but cannot be <b>null</b>.
        /// </param>
        /// 
        /// <param name="contentType">
        /// The content type of the BLOB.
        /// </param>
        /// 
        /// <param name="currentContentEncoding">
        /// The current content encoding of the BLOB or <b>null</b> if the BLOB is not encoded.
        /// </param>
        /// 
        /// <param name="legacyContentEncoding">
        /// The previous content encoding of the BLOB (if any).
        /// </param>
        /// 
        /// <param name="hashInfo">
        /// The hash information for the BLOB.
        /// </param>
        /// 
        /// <param name="connectPackageParameters">
        /// The creation parameters for the <see cref="ConnectPackage"/> that will host the 
        /// <see cref="HealthRecordItem"/> that contains this blob.
        /// </param>
        /// 
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="name"/> or <paramref name="contentType"/> 
        /// or <paramref name="connectPackageParameters"/> is <b>null</b>.
        /// </exception>
        /// 
        internal Blob(
            string name,
            string contentType,
            string currentContentEncoding,
            string legacyContentEncoding,
            BlobHashInfo hashInfo,
            ConnectPackageCreationParameters connectPackageParameters)
        {
            Validator.ThrowIfArgumentNull(name, "name", "StringNull");
            Validator.ThrowIfArgumentNull(contentType, "contentType", "StringNull");
            Validator.ThrowIfArgumentNull(connectPackageParameters, "connectPackageParameters", "ArgumentNull");

            _name = name;
            _contentType = contentType;
            _contentEncoding = currentContentEncoding;
            _legacyContentEncoding = legacyContentEncoding;
            _blobHashInfo = hashInfo;
            _connectPackageParameters = connectPackageParameters;
        }
        private void WriteNewInlineData(byte[] bytes)
        {
            BlobHasher inlineHasher = BlobHasher.InlineBlobHasher;
            byte[] blobHash = inlineHasher.CalculateBlobHash(bytes, 0, bytes.Length);

            _url = null;
            _inlineData = bytes;
            _length = bytes.Length;

            _blobHashInfo = new BlobHashInfo(
                inlineHasher.BlobHashAlgorithm,
                inlineHasher.BlockSize,
                blobHash);

            IsDirty = true;
        }
        /// <summary>
        /// Constructs an instance of the Blob class with the specified values.
        /// </summary>
        /// 
        /// <param name="name">
        /// The name of the BLOB. It can be <see cref="String.Empty"/> but cannot be <b>null</b>.
        /// </param>
        /// 
        /// <param name="contentType">
        /// The content type of the BLOB.
        /// </param>
        /// 
        /// <param name="currentContentEncoding">
        /// The current content encoding of the BLOB or <b>null</b> if the BLOB is not encoded.
        /// </param>
        /// 
        /// <param name="legacyContentEncoding">
        /// The previous content encoding of the BLOB (if any).
        /// </param>
        /// 
        /// <param name="hashInfo">
        /// The hash information for the BLOB.
        /// </param>
        /// 
        /// <param name="record">
        /// The health record to write the BLOB data to.
        /// </param>
        /// 
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="name"/> or <paramref name="contentType"/> is <b>null</b>.
        /// </exception>
        /// 
        internal Blob(
            string name, 
            string contentType,
            string currentContentEncoding, 
            string legacyContentEncoding,            
            BlobHashInfo hashInfo,
            HealthRecordAccessor record)
        {
            Validator.ThrowIfArgumentNull(name, "name", "StringNull");
            Validator.ThrowIfArgumentNull(contentType, "contentType", "StringNull");

            _name = name;
            _contentType = contentType;
            _contentEncoding = currentContentEncoding;
            _legacyContentEncoding = legacyContentEncoding;
            _blobHashInfo = hashInfo;
            _record = record;
        }