{
Exception exception = null;
try
{
FSTObjectOutput out = fastSerializationConfig.getObjectOutput();
if (listener != null)
{
out.setListener(new ListenerAdapter(listener));
listener.begin(object);
}
out.writeObject(object);
out.setListener(null);
return out.getCopyOfWrittenBuffer();
}
catch (Exception e)
{
exception = e;
throw new FastWicketSerialException(String.format(