G
Guest
Hey there,
I need a string stream, but I can't find one in .NET. I thought StringWriter
would derive from Stream, alas it doesn't do so.
Which leads me to my next question: What is the purpose of
System.IO.StringWriter (or, what is its added value)??? It can do the same
things with StringBuilder, and I see no added value.
The reason why I need the string stream, is that I have a library that knows
how to serialize certain library objects to a System.IO.Stream. My intent is
to serialize to a string, but I cannot do that with the current interface.
I do know that there is a memory stream. But my other string ouput methods
use StringBuilder..., not any preallocated byte buffer.
What I would prefer, is a StringStream class that derives from Stream, and
takes a StringBuilder as scratch-pad.
Any comment is welcome.
Thanks,
I need a string stream, but I can't find one in .NET. I thought StringWriter
would derive from Stream, alas it doesn't do so.
Which leads me to my next question: What is the purpose of
System.IO.StringWriter (or, what is its added value)??? It can do the same
things with StringBuilder, and I see no added value.
The reason why I need the string stream, is that I have a library that knows
how to serialize certain library objects to a System.IO.Stream. My intent is
to serialize to a string, but I cannot do that with the current interface.
I do know that there is a memory stream. But my other string ouput methods
use StringBuilder..., not any preallocated byte buffer.
What I would prefer, is a StringStream class that derives from Stream, and
takes a StringBuilder as scratch-pad.
Any comment is welcome.
Thanks,