Update IKVM sources
[mono.git] / mcs / class / IKVM.Reflection / Universe.cs
index 99ba29af5f53cf9cd7cd9b669836acb3bc215f6e..4e32b79b288ed1444d1219c1522b04ae730afeb4 100644 (file)
@@ -529,9 +529,9 @@ namespace IKVM.Reflection
 
                public RawModule OpenRawModule(Stream stream, string location)
                {
-                       if (!stream.CanRead || !stream.CanSeek)
+                       if (!stream.CanRead || !stream.CanSeek || stream.Position != 0)
                        {
-                               throw new NotSupportedException();
+                               throw new ArgumentException("Stream must support read/seek and current position must be zero.", "stream");
                        }
                        return new RawModule(new ModuleReader(null, this, stream, location));
                }