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);
}
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/