CSharpTest.Net
ReadAllText Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > IOStream Class : ReadAllText Method

io
encoding

Glossary Item Box

Reads all of the bytes from the input stream, input stream will be disposed

Syntax

Visual Basic (Declaration) 
Public Shared Function ReadAllText( _
   ByVal io As Stream, _
   ByVal encoding As Encoding _
) As String
C# 
public static string ReadAllText( 
   Stream io,
   Encoding encoding
)

Parameters

io
encoding

Example

Library/Library.Test/TestSecureString.cs

C#Copy Code
byte[] expect = Encoding.Unicode.GetBytes(TEST_PASSWORD);
foreach (SecureString ss in MakeStrings())
{
    Assert.AreEqual(expect, IOStream.ReadAllBytes(SecureStringUtils.ToStream(ss)));
    Assert.AreEqual(TEST_PASSWORD, IOStream.ReadAllText(SecureStringUtils.ToStream(ss), Encoding.Unicode));
}
VB.NETCopy Code
Dim expect As Byte() = Encoding.Unicode.GetBytes(TEST_PASSWORD)
For Each ss As SecureString In MakeStrings()
    Assert.AreEqual(expect, IOStream.ReadAllBytes(SecureStringUtils.ToStream(ss)))
    Assert.AreEqual(TEST_PASSWORD, IOStream.ReadAllText(SecureStringUtils.ToStream(ss), Encoding.Unicode))
Next

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys