Please tell me how to differentiate objects from ObjectInputStream.Like whether it is String , Image or etc...?
+2
A:
You'll have to know what to expect and cast it. You may also do checks with instanceof or do something more sophisticated like register handlers in a map where you do
map.get(object.getClass()).handle(object);
But most importantly, you must know what objects you can expect to write proper handling code.
sfussenegger
2009-10-12 12:22:46