Skip to content

Instantly share code, notes, and snippets.

@StephenRedd
Created May 23, 2011 11:01
Show Gist options
  • Select an option

  • Save StephenRedd/986546 to your computer and use it in GitHub Desktop.

Select an option

Save StephenRedd/986546 to your computer and use it in GitHub Desktop.
blog: Fail Loop
using (FileStream rdr = new FileStream(contentInfo.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{ {
index = 1;
while (true)
{
long offset = (index - 1) * chunkSize;
long remaining = contentInfo.Length - offset;
if (remaining < 1) break; // Stop processing, at the end of the file
// stuff that doesn't ever touch the index variable
index++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment