HttpResponse.Filter how determine End of stream
Posted
by Erik
on Stack Overflow
See other posts from Stack Overflow
or by Erik
Published on 2010-05-20T11:24:42Z
Indexed on
2010/05/20
11:30 UTC
Read the original article
Hit count: 309
c#
|httpresponse
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?
© Stack Overflow or respective owner