Microsoft.WindowsAzure.Commands.Tools.Vhd.Model.Persistence.BlockAllocationTableFactory.CreateAsync C# (CSharp) Method

CreateAsync() private method

private CreateAsync ( AsyncMachine machine ) : IEnumerable
machine AsyncMachine
return IEnumerable
        private IEnumerable<CompletionPort> CreateAsync(AsyncMachine<BlockAllocationTable> machine)
        {
            dataReader.SetPosition(header.TableOffset);

            var bat = new uint[header.MaxTableEntries];
            for (int block = 0; block < header.MaxTableEntries; block++)
            {
                dataReader.BeginReadUInt32(machine.CompletionCallback, null);
                yield return CompletionPort.SingleOperation;
                bat[block] = dataReader.EndReadUInt32(machine.CompletionResult);
            }
            machine.ParameterValue = new BlockAllocationTable(header.MaxTableEntries, header.BlockSize, bat);
        }
    }