encoder.writeObject( descriptor ); encoder.close();
encoder.setExceptionListener( new RegistryEncoderListener() ); ClassLoader current = Thread.currentThread().getContextClassLoader(); try { ClassLoader context = RegistryDescriptor.class.getClassLoader(); Thread.currentThread().setContextClassLoader( context ); encoder.writeObject( descriptor ); } finally { Thread.currentThread().setContextClassLoader( current ); encoder.close(); }
    public void flush() throws IOException    {        synchronized( getLock() )        {            if( null == m_url )            {                return;            }            Entry[] entries = getEntries();            RegistryDescriptor descriptor = new RegistryDescriptor( entries );            OutputStream output = m_url.openConnection().getOutputStream();            BufferedOutputStream buffer = new BufferedOutputStream( output );            XMLEncoder encoder = new XMLEncoder( buffer );            encoder.writeObject( descriptor );            encoder.close();        }    }