我知道有一种方法可以使for
循环像循环一样工作while
。
我有这个代码工作:
while (BR.BaseStream.Position < BR.BaseStream.Length) // BR = BinaryReader
{
int BlockLength = BR.ReadInt32();
byte[] Content = BR.ReadBytes(BlockLength);
}
我需要for
这个循环的等价物while
..
到目前为止,我有这个:
for (long Position = BR.BaseStream.Position; Position < BR.BaseStream.Length; //Don't Know This)
{
int BlockLength = BR.ReadInt32();
byte[] Content = BR.ReadBytes(BlockLength);
}