{
responseContentType = responseObject == null ? requestContentType : WebUtil.getContentType(responseObject);
}
response.setContentType(responseContentType);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Marshaller marshaller = getMarshaller();
if (marshaller instanceof VersionedMarshaller)
((VersionedMarshaller) marshaller).write(responseObject, outputStream, getVersion());
else
marshaller.write(responseObject, outputStream);
retval = outputStream.toByteArray();
response.setContentLength(retval.length);
}
}