[Mono-bugs] [Bug 39280][Nor] New - StreamReader.Peek () should throw when base stream is closed

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Fri, 7 Mar 2003 09:43:37 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ndrochak@gol.com.

http://bugzilla.ximian.com/show_bug.cgi?id=39280

--- shadow/39280	Fri Mar  7 09:43:37 2003
+++ shadow/39280.tmp.538	Fri Mar  7 09:43:37 2003
@@ -0,0 +1,33 @@
+Bug#: 39280
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 8.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ndrochak@gol.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: StreamReader.Peek () should throw when base stream is closed
+
+The following code should throw an ObjectDisposedException:
+----------------------------------------------
+using System;
+using System.IO;
+
+class C {
+	public static void Main () {
+		Byte[] b = {};
+		MemoryStream m = new MemoryStream(b);
+		StreamReader r = new StreamReader(m);
+		m.Close();
+		int nothing = r.Peek();
+	}
+
+}