private void EndReadSourceBlock(IAsyncResult readAsyncResult)
        {
            var readByteBlock = (_OrderedByteBlock)readAsyncResult.AsyncState;

            readByteBlock.Stream.EndRead(readAsyncResult);
            _byteBlocksToCompress.Add(readByteBlock.Order, readByteBlock.Bytes);
        }
Example #2
0
        private void EndReadSourceBlock(IAsyncResult readAsyncResult)
        {
            var readByteBlock = (_OrderedByteBlock)readAsyncResult.AsyncState;

            if ((readByteBlock.Length = readByteBlock.Stream.EndRead(readAsyncResult)) > 0)
            {
                _byteBlocksToCompress.Add(readByteBlock.Order, readByteBlock);
            }
            else
            {
                _byteBlockPool.Release(readByteBlock.Bytes);
            }
        }