public static void writeObject(OutputStream out,Object obj) throws IOException {
  ObjectOutputStream objOut=new ObjectOutputStream(out);
  objOut.writeObject(obj);
  objOut.flush();
}

public static void writeObject ( OutputStream out , Object obj ) throws IOException { ObjectOutputStream objOut = new ObjectOutputStream ( out ) ; objOut . writeObject ( obj ) ; objOut . flush ( ) ; }
write an object to an outputstream
