{
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 Fast2WicketSerialException(String.format(