如果我在服务器端,给流里面连续写两个对象,如下:
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream);
oos.writeObject(user);//user不为空
oos.writeObject(command);//command不为空
那么我在客户端用
ois.readObject();
读一个对象时,始终读不到第二个,该怎么做?
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream);
oos.writeObject(user);//user不为空
oos.writeObject(command);//command不为空
那么我在客户端用
ois.readObject();
读一个对象时,始终读不到第二个,该怎么做?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货