T
Tony Johansson
Hi!
I know about the dispose pattern so you don't have to remaind me about that.
In this small code snipped(marked Ex1) an internal buffer(exist by default)
is used to store the data and when we do a flush or when the internal buffer
is full the data is forced to to underlaying stream.
Now to my question is it any point to use BufferedStream(Ex2) when you write
to a FileStream.
I mean we always have an internal buffer by default and this internal buffer
is probably large enought most of the times ?
Ex1
FileStream fs = new FileStream("Test.txt",FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.Close();
fs.Close();
Ex2
//Here an example of the BufferedStream
FileStream fileStream = new FileStream("Test.txt",FileMode.Create);
BufferedStream buffStream = new BufferedStream(fileStream );
StreamWriter sw = new StreamWriter(buffStream );
sw.Close();
buffStream.Close();
fileStream .Close();
//Tony
I know about the dispose pattern so you don't have to remaind me about that.
In this small code snipped(marked Ex1) an internal buffer(exist by default)
is used to store the data and when we do a flush or when the internal buffer
is full the data is forced to to underlaying stream.
Now to my question is it any point to use BufferedStream(Ex2) when you write
to a FileStream.
I mean we always have an internal buffer by default and this internal buffer
is probably large enought most of the times ?
Ex1
FileStream fs = new FileStream("Test.txt",FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.Close();
fs.Close();
Ex2
//Here an example of the BufferedStream
FileStream fileStream = new FileStream("Test.txt",FileMode.Create);
BufferedStream buffStream = new BufferedStream(fileStream );
StreamWriter sw = new StreamWriter(buffStream );
sw.Close();
buffStream.Close();
fileStream .Close();
//Tony