What I need is a buffer (about 10kb) which can be flushed any time.

Besides in my case I can never know whether the user will write 1 line of text in an hour, or 1000 lines of text in a second, so I need something that is capable of keeping the connection to the file when not writing, and allowing outside sources to use the file, again when not writing...

What's a good class for that?

I tried stream writer, but I am not sure if that's the optimal solution...