This blog describes the workaround for the Windows 8 error described in the previous blog "Windows 8 Release Preview – to boldly go where…"

Workaround

Hurray, we got a workaround for the problem of the previous blog. This works:

IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);

for (ulong i = 0; i < stream.Size; i++) { stream.Seek(i);

byte[] data = new byte[1];

await stream.ReadAsync(data.AsBuffer(), 1, InputStreamOptions.None);

if (stream.Position > stream.Size)
{
   // Never happens, which is as expected.

}

}

The credits for finding this go to Gionata from paperlit.com. Thanks!

Note that the main difference appears to be:

IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);

As opposed to:

Stream stream = await file.OpenStreamForReadAsync();

Weird, eh? One would say that both expressions are basically synonymous.Well, this means back to work, were it not for the summer holidays…