23,404
社区成员
发帖
与我相关
我的任务
分享for (StreamFactory currentStream : myMainFram.myStreamFactory) {
if(currentStream.getDescsString().equals(ClientListJPanel.getItemAt(myServer.getSelectedClient()))){
byte[] temp = NetSendArea.getText().getBytes();
for (byte a : temp) {
try {
currentStream.getMybBlockQueueTool().getTxQueue().put(a);;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("原数据"+a);
}
}
}while(true){
Byte temp = null;
try {
temp = myBlockQueueTool.getTxQueue().poll(10, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(temp != null){
System.out.println(temp.byteValue());
try {
myiInOutPutStream.getMyoutputStream().write(temp.byteValue());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else {
break;
}
}