Amazon.Runtime.Internal.Util.EventStream.BeginRead C# (CSharp) Метод

BeginRead() публичный Метод

public BeginRead ( byte buffer, int offset, int count, AsyncCallback callback, Object state ) : IAsyncResult
buffer byte
offset int
count int
callback AsyncCallback
state Object
Результат IAsyncResult
        public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state)
        {
            var result = new AsyncResult()
            {
                AsyncState = state,
                CompletedSynchronously = true,
                IsCompleted = true,
                AsyncWaitHandle = new ManualResetEvent(true)
            };

            try
            {
                int bytesRead = this.Read(buffer, offset, count);
                result.Return = bytesRead;
            }
            catch (Exception e)
            {
                result.Return = e;
            }

            if (callback != null)
                callback(result);

            return result;
        }