62,615
社区成员
发帖
与我相关
我的任务
分享
private void handler(){
try {
Message message = new Message();
message.setMessageId(this.userID+this.getId());
ObjectOutputStream outObject = new ObjectOutputStream(new FileOutputStream(this.userID+this.getId()));
outObject.writeObject(message);
outObject.flush();
outObject.close();
ObjectInputStream inObject = new ObjectInputStream(new FileInputStream(this.userID+this.getId()));
byte[]b = new byte[1024*1024*10];
int r = 0;
while((r = inObject.read(b, 0, 1024*1024*10))>-1){
byte[]bs = new byte[r];
System.arraycopy(b, 0, bs, 0, r);
//发送对象(远程主机ID,序列化对象);
send("99999999",bs);
}
inObject.close();
} catch (IOException e) {
e.printStackTrace();
}
}