📄 receiver.java
字号:
/*
* Receiver.java
*
* Created on 2006年9月15日, 下午5:47
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package example7_4;
import java.io.*;
import java.util.*;
/**
*
* @author Administrator
*/
public class Receiver extends Thread{
/** Creates a new instance of Receiver */
public Receiver() {
}
PipedInputStream in = new PipedInputStream();
public PipedInputStream getIn(){return in;}
public void run()
{byte [] buf = new byte[1024];
try
{int len = in.read(buf); //将管道中的内容读入字节数组buf中
System.out.println("the following is from sender:\n"+new String(buf,0,len));
in.close(); //关闭当前管道输入流
}catch(Exception e){e.printStackTrace();}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -