I'm writing some text to a memory stream and need to modify it once in the memory stream. The reason I can't modify prior to adding to the memory stream is that it is from some 3rd party component. Here is an example:

ms = New MemoryStream
doc.Save(ms, SaveFormat.Html)

I need to do some modification to the resulting text that ends up in ms. Is there a way to convert the contents of ms into a string, and then back into a memory stream once modified?