*
* @see de.netseeker.ejoe.adapter.SerializeAdapter#write(java.lang.Object, java.io.OutputStream)
*/
public void write( Object obj, OutputStream out ) throws Exception
{
XMLEncoder encoder = new XMLEncoder( out );
encoder.setExceptionListener( this );
try
{
// see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4426674
encoder.setPersistenceDelegate( BigInteger.class, encoder.getPersistenceDelegate( Integer.class ) );
encoder.setPersistenceDelegate( BigDecimal.class, encoder.getPersistenceDelegate( Integer.class ) );
encoder.writeObject( obj );
}
finally
{
encoder.close();
}
}