catch(IOException e) {
System.err.println("连接失败");
System.exit(1);
}
byte[] inArray = new byte[10];
int bytesRead = 0;
// 启动写操作线程
startWriterThread();
try {
bytesRead = pipedIS.read(inArray, 0, 10);
while(bytesRead != -1) {
System.out.println("已经读取" +
bytesRead + "字节...");
bytesRead = pipedIS.read(inArray, 0, 10);
}
}
catch(IOException e) {
System.err.println("读取输入错误.");
System.exit(1);
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/