public static void writeAll(OutputStream stream,Object[] o) throws Exception {
  ObjectOutputStream oos;
  int i;
  if (!(stream instanceof BufferedOutputStream)) {
    stream=new BufferedOutputStream(stream);
  }
  oos=new ObjectOutputStream(stream);
  for (i=0; i < o.length; i++) {
    oos.writeObject(o[i]);
  }
  oos.flush();
  oos.close();
}

public static void writeAll ( OutputStream stream , Object [ ] o ) throws Exception { ObjectOutputStream oos ; int i ; if ( ! ( stream instanceof BufferedOutputStream ) ) { stream = new BufferedOutputStream ( stream ) ; } oos = new ObjectOutputStream ( stream ) ; for ( i = 0 ; i < o . length ; i ++ ) { oos . writeObject ( o [ i ] ) ; } oos . flush ( ) ; oos . close ( ) ; }
serializes the given objects to the specified stream .
