Streams, MemoryStream, StreamReader... questions

lordofduct

Well-known member
Joined
Jun 24, 2010
Messages
71
Programming Experience
3-5
Ok, I'm not well versed in the System.IO namespace, and I don't know if there are class types elsewhere that may serve my purpose.

But I need two special things...

a MemoryStream or StreamWriter that treats the stream as a fixed line length. So that when a new line is written to it, the earlier lines get cut off... i.e. if fixed max length is 3 we get:

1
12
123
234
345
456
...



This is not directly related to the above, in that I'm looking for something that works with all streams, not just the previously mentioned stream.

And a StreamReader that can allow me to move to specific lines so I can read the last few lines of a Stream easily. I want to easily just pop off the last 5 or 10 lines of a text stream.



Of course I could go about writing my own classes for this, just wondering if anyone knows of anything out there that already exists. A .Net framework native class would probably be far more efficient then anything I'd write.
 
Back
Top