question: public static void eachObject ( ObjectInputStream ois , Closure closure ) throws IOException , ClassNotFoundException { try { while ( true ) { try { Object obj = ois . readObject ( ) ; closure . call ( obj ) ; } catch ( EOFException e ) { break ; } } InputStream temp = ois ; ois = null ; temp . close ( ) ; } finally { closeWithWarning ( ois ) ; } }
target:  Iterates through the given object stream object by object. The ObjectInputStream is closed afterwards.