Esempio n. 1
0
        /// <summary>
        /// Retrieve an object from the deduplication index.
        /// This method will use the callbacks supplied in the method signature.
        /// </summary>
        /// <param name="objectName">The name of the object.</param>
        /// <param name="callbacks">CallbackMethods object containing callback methods.</param>
        /// <param name="data">The byte data from the object.</param>
        /// <returns>True if successful.</returns>
        public bool RetrieveObject(string objectName, CallbackMethods callbacks, out byte[] data)
        {
            bool success = RetrieveObject(objectName, callbacks, out long contentLength, out Stream stream);

            data = DedupeCommon.StreamToBytes(stream);
            return(success);
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieve an object from the deduplication index.
        /// </summary>
        /// <param name="objectName">The name of the object.</param>
        /// <param name="data">The byte data from the object.</param>
        /// <returns>True if successful.</returns>
        public bool RetrieveObject(string objectName, out byte[] data)
        {
            long   contentLength = 0;
            Stream stream        = null;
            bool   success       = RetrieveObject(objectName, Callbacks, out contentLength, out stream);

            data = DedupeCommon.StreamToBytes(stream);
            return(success);
        }
Esempio n. 3
0
        /// <summary>
        /// Retrieve an object from the deduplication index.
        /// </summary>
        /// <param name="objectName">The name of the object.</param>
        /// <param name="data">The byte data from the object.</param>
        /// <returns>True if successful.</returns>
        public bool RetrieveObject(string objectName, out byte[] data)
        {
            bool success = RetrieveObject(objectName, Callbacks, out long contentLength, out Stream stream);

            if (stream.Length == 0)
            {
                data = new byte[0];
                return(false);
            }
            else
            {
                data = DedupeCommon.StreamToBytes(stream);
                return(success);
            }
        }