by soulbeam » Fri Jun 18, 2004 3:24 am
So I pass the StringWriter constructor a MemoryStream, but how can i now read from it? I keep getting an exception thrown. here is my code...
private System.IO.StreamWriter logWriter;
private System.IO.StreamReader logReader;
private System.IO.MemoryStream memStream;
MemoryStream memStream = new MemoryStream();
this.logWriter = new StreamWriter(memStream);
this.logReader = new StreamReader(memStream);
private void logIt()
{
logBox.Text = FromASCIIByteArray(memStream.ToArray());
}
public static string FromASCIIByteArray(byte[] characters)
{
ASCIIEncoding encoding = new ASCIIEncoding( );
string constructedString = encoding.GetString(characters);
return (constructedString);
}