How to string multiple TextReaders together?

Posted by Ken on Stack Overflow See other posts from Stack Overflow or by Ken
Published on 2010-05-27T23:09:06Z Indexed on 2010/05/27 23:11 UTC
Read the original article Hit count: 260

I have 3 TextReaders -- a combination of StreamReaders and StringReaders. Conceptually, the concatenation of them is a single text document.

I want to call a method (not under my control) that takes a single TextReader. Is there any built-in or easy way to make a concatenating TextReader from multiple TextReaders?

(I could write my own TextReader subclass, but it looks like a fair amount of work. In that case, I'd just write them all out to a temp file and then open it with a single StreamReader.)

Is there an easy solution to this that I'm missing?

© Stack Overflow or respective owner

Related posts about c#

Related posts about concatenation