62,614
社区成员
发帖
与我相关
我的任务
分享
public Command<?> read()
{
Command<?> cmd=null;
ObjectInputStream in = null;
try {
in=new ObjectInputStream(client.getInputStream());
cmd=(Command<?>)in.readObject();
return cmd;
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
finally
{
if(in!=null)
{
try {
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}