Skip to content

Instantly share code, notes, and snippets.

@jechtom
Last active August 29, 2015 14:02
Show Gist options
  • Save jechtom/282220a87e694e09b076 to your computer and use it in GitHub Desktop.
Save jechtom/282220a87e694e09b076 to your computer and use it in GitHub Desktop.
bool ok = false;
// make sure all data has been written
while (fileStream.Position < fileStream.Length || !(ok = true))
{
var data = _dataSerializer.Read(fileStream);
if (data == null) // if null, data is corrupted
break;
checkedDataLength = fileStream.Position;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment