Re: ReplacerStream



To make my self more clear, for instance you should be able to replace
all occurences of "wrongstring" with "rightstring". I think at least
this would requiring buffering, because you can't tell whether you
must replace untill all the bytes of the "wrongstring" have been read.

What I am doing now as a workaround is reading the stream into a
string, do a replace on that string and create a stream again to be
read base on that string. But this is not the most elegant and
performing way:

string _strXml = null;
using (TextReader tr = new StreamReader(stream))
{
_strXml = tr.ReadToEnd();
_strXml = _strXml.Replace(wrongstring,rightstring);
tr.Close();
}


using (StringReader _stringReader = new StringReader(_strXml))
{ etc...

.



Relevant Pages

  • Re: Question about design, defmacro, macrolet, and &environment
    ... "Expects to find the literal string on the stream." ... (defun send (string &optional stream) ... (declaim (inline make-adjustable-string)) ...
    (comp.lang.lisp)
  • Re: Strange problem when not in debugger
    ... private string huidigWeb; ... int buffLength = 2048; ... // Opens a file stream to read the file to be uploaded ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ReplacerStream
    ... string, do a replace on that string and create a stream again to be ... If those are problems, and you are looking just for a single string, it seems to me that you could just read the stream one character at a time, checking to see if it matches the current character in your search string. ...
    (microsoft.public.dotnet.framework)
  • Re: Strange problem when not in debugger
    ... private string huidigWeb; ... int buffLength = 2048; ... // Opens a file stream to read the file to be uploaded ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: HTTP Object and Retrieving HTML Programatically
    ... I had to hardcode some query string and form post values, ... chunks defined by the buffer size ... //create a stream reader grabbing text we get over HTTP ... while (workingbuffersize> 0) ...
    (microsoft.public.dotnet.framework.aspnet)

Loading