sample: Fix GtkDemo/DemoImages.cs on Windows

Calling .PeekChar on a binary stream can cause an ArgumentException
because it tries to decode the byte.
This commit is contained in:
Bertrand Lorentz 2014-05-24 17:21:29 +02:00
parent a6c9634748
commit 233614e18b

View file

@ -156,7 +156,7 @@ namespace GtkDemo
pixbufLoader.AreaUpdated += new AreaUpdatedHandler (ProgressiveUpdatedCallback);
}
if (imageStream.PeekChar () != -1) {
if (imageStream.BaseStream.Position != imageStream.BaseStream.Length) {
byte[] bytes = imageStream.ReadBytes (256);
pixbufLoader.Write (bytes);
return true; // leave the timeout active