I got a HttpResponse.Filter filter that replaces text in the HTML.
I've created a class that derives from Stream and implemented the Write method:
public override void Write(byte[] buffer, int offset, int count)
I read all bytes from buffer and store them in a private StringBuilder, then I replace the text, and write the string back to the Stream.
But how can I determine when the stream is at the end of the stream. I.e. how do I determine when to write back the html (string) to the stream?