System.out.println("readObject called for class A"); try { stream.defaultReadObject(); } catch (ClassNotFoundException e) { throw new IOException(); }
System.out.println("writeObject called for class A"); stream.defaultWriteObject();