I have an InputStream which takes the html file as input parameter. I have to get the bytes from the input stream .
I have a string: \"XYZ\". I\'d like
The following approach will work but I don't how big the impact is on the performance.
InputStream with a InputStreamReader,InputStreamReader with a FilterReader that replaces the strings, then FilterReader with a ReaderInputStream.It is crucial to choose the appropriate encoding, otherwise the content of the stream will become corrupted.
If you want to use regular expressions to replace the strings, then you can use Streamflyer, a tool of mine, which is a convenient alternative to FilterReader. You will find an example for byte streams on the webpage of Streamflyer. Hope this helps.