我正在尝试读取服务器上从客户端发送的值。第一次工作正常,但再次阅读会出现异常。
String extension=getFileExtension(file);
OutputStream out;
out = socket.getOutputStream();
ObjectOutputStream oout = new ObjectOutputStream(out);
oout.writeObject(extension);
String extension="";
InputStream in;
in = socket.getInputStream();
ObjectInputStream iin = new ObjectInputStream(in);//It gives exception here second time in same running the program
extension = (String)iin.readObject();