Visual Basic (Declaration) | |
---|---|
Public Class NonClosingStream Inherits AggregateStream |
C# | |
---|---|
public class NonClosingStream : AggregateStream |
Library/Library.Test/TestStreams.cs
C# | Copy Code |
---|---|
MemoryStream ms = new MemoryStream(new byte[5]); Assert.AreEqual(5, ms.Length); using (Stream s = new NonClosingStream(ms)) s.Close(); Assert.AreEqual(5, ms.Length); Assert.AreEqual(0, ms.Position); Assert.IsTrue(ms.CanRead); Assert.AreEqual(5, ms.Read(new byte[10], 0, 10)); |
VB.NET | Copy Code |
---|---|
Dim ms As New MemoryStream(New Byte(5) {}) Assert.AreEqual(5, ms.Length) Using s As Stream = New NonClosingStream(ms) s.Close() End Using Assert.AreEqual(5, ms.Length) Assert.AreEqual(0, ms.Position) Assert.IsTrue(ms.CanRead) Assert.AreEqual(5, ms.Read(New Byte(10) {}, 0, 10)) |
System.Object
System.MarshalByRefObject
System.IO.Stream
CSharpTest.Net.IO.AggregateStream
CSharpTest.Net.IO.NonClosingStream
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
NonClosingStream MembersCSharpTest.Net.IO Namespace