example7_4.java
来自「《Java程序设计与应用》-张仕斌-源程序 《Java程序设计与应用》-张仕斌」· Java 代码 · 共 41 行
JAVA
41 行
/*
* Example7_4.java
*
* Created on 2006年9月15日, 下午5:35
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package example7_4;
import java.io.*;
/**
*
* @author Administrator
*/
public class Example7_4 {
/** Creates a new instance of Example7_4 */
public Example7_4() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic hereimport java.io.*;
Sender s = new Sender();
Receiver r = new Receiver();
PipedOutputStream out = s.getOut();
PipedInputStream in = r.getIn();
try
{
in.connect(out); //将当前管道输入流连接到一个发送者
s.start(); r.start();
}
catch(Exception e){e.printStackTrace();}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?