p.writeObject(e.nextElement());
try { p.writeObject(e.nextElement()); } catch (NotSerializableException nsx) {  app.logError("Error serializing session.", nsx); }
    public void storeSessionData(File f) {        if (f == null) {            f = new File(app.dbDir, "sessions");        }        try {            OutputStream ostream = new BufferedOutputStream(new FileOutputStream(f));            ObjectOutputStream p = new ObjectOutputStream(ostream);            synchronized (sessions) {                p.writeInt(sessions.size());                for (Enumeration e = sessions.elements(); e.hasMoreElements();) {                    p.writeObject(e.nextElement());                }            }            p.flush();            ostream.close();            app.logEvent("stored " + sessions.size() + " sessions in file");        } catch (Exception e) {            app.logEvent("error storing session data: " + e.toString());        }    }