Java的PipedReader / PipedWriter当量在C#中? [英] Java's PipedReader / PipedWriter equivalents in C#?

查看:160
本文介绍了Java的PipedReader / PipedWriter当量在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经定义了在Java类管道,利用 PipedReader PipedWriter 的。我现在想移植这个相同的类为C#。是有可能完成同样的,如图以下code在C#?

I have defined a Pipe class in Java, making use of PipedReader and PipedWriter. I am now trying to port this same class to C#. Is it possible to accomplish the same as shown in the following code in C#?

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

    public Pipe() {
        pipedWriter.connect(pipedReader);
    }

        ...
}

我猜我会想在C#中使用 PipedReader PipedWriter 的StreamReader 的StreamWriter

有什么样一个连接()的方法?

所以,我的目标是实现(小)管及放大器,滤波器架构。 我的想法是创建一个管道类和过滤器类,这样当我需要实现使用管道和放一些系统,过滤器的建筑风格,我会code这对我使用这个小框架。 每个过滤器将运行在自己的线程。

So, my goal is to implement a (little) Pipe&Filter framework. My idea would be to create a Pipe class and Filter classes, so that when I need to implement some system using a Pipe&Filter architecture style, I'll code it against this little framework I am using. Each filter would run on its own thread.

感谢

推荐答案

我不知道,如果这是你在寻找什么,但对使用的.Net管道的此处。这只会与.net 3.5 +工作。

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

编辑:

有关于使用匿名管道例子MSDN上。请参见此链接

There are examples on MSDN about using anonymous pipes. See this link.

这篇关于Java的PipedReader / PipedWriter当量在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆