Developer technologies | Universal Windows Platform (UWP)
A Microsoft platform for building and publishing apps for Windows devices.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
using (Stream stream = await storageFile.OpenStreamForReadAsync())
{
BinaryReader br = new BinaryReader(stream);
List<byte> list = new List<byte>();
try
{
while (true)
{
list.Add(br.ReadByte());
}
}
catch (NotImplementedException)
{
}
}
The above code works fine most of the time. Occasionally, br.ReadByte() in the above code throws the exception:
System.NotImplementedException: The method or operation is not implemented.
Stack Trace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.IO.StreamOperationAsyncResult.ThrowWithIOExceptionDispatchInfo(Exception) + 0x31
at System.IO.StreamOperationAsyncResult.ProcessCompletedOperation() + 0x109
at System.IO.WinRtToNetFxStreamAdapter.EndRead(IAsyncResult) + 0x10d
at System.IO.WinRtToNetFxStreamAdapter.Read(Byte[], Int32, Int32) + 0x2b
at SharedLibrary!<BaseAddress>+0xb91583
at System.IO.BufferedStream.ReadByte() + 0x11
at System.IO.BinaryReader.ReadByte() + 0x16
Could anyone shed some light on the possible cause?
I want to emphasize this is rare, so it is not a serious problem. I am asking out of curiosity.
A Microsoft platform for building and publishing apps for Windows devices.