Equivalent to Java PipedReader / PipedWriter in C #?

I defined the Pipe class in Java using PipedReader and PipedWriter . Now I'm trying to port the same class to C #. Is it possible to do the same as shown in the following C # code?

 public final class Pipe { private final PipedReader pipedReader = new PipedReader(); private final PipedWriter pipedWriter = new PipedWriter(); public Pipe() { pipedWriter.connect(pipedReader); } ... } 

I guess what I want to use in C # for PipedReader and PipedWriter will be StreamReader and StreamWriter ?

Is there something like connect() method?

Edit

So my goal is to implement the (small) Pipe & Filter structure. My idea would be to create Pipe and Filter class classes, so when I need to implement some system using the Pipe & Filter architecture style, I will code it using this small structure that I use. Each filter will work in its own thread.

thanks

+1
c # stream
source share
1 answer

I'm not sure if this is exactly what you are looking for, but there is a tutorial on using .Net channels here . This will only work with .Net 3.5+.

EDIT:

MSDN has examples of using anonymous channels. See this link .

+3
source share

All Articles