Example #1
0
        /// <summary>
        /// Extends BeginRead so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// stream.BeginRead(buffer, offset, count, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginRead(this CryptoStream stream, Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            return(stream.BeginRead(buffer, offset, count, callback, null));
        }
Example #2
0
        /// <summary>
        /// Extends BeginRead so that buffer offset of 0 and call to Array.Length are not needed.
        /// <example>
        /// stream.BeginRead(buffer, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginRead(this CryptoStream stream, Byte[] buffer, AsyncCallback callback)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }

            return(stream.BeginRead(buffer, 0, buffer.Length, callback));
        }
Example #3
0
 public IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 {
     return(_decryptStream.BeginRead(buffer, offset, count, callback, state));
 }