ByteArrayOutputStream os = new ByteArrayOutputStream();
serializer.setOutputStream(os);
this.toSAX(serializer);
return new ByteArrayInputStream(os.toByteArray());
} catch (SAXException se) {
throw new CascadingIOException("Unable to stream content.", se);
} catch (ServiceException ce) {
throw new CascadingIOException("Unable to get components for serializing.", ce);
} finally {
if ( serializer != null ) {
serializerSelector.release(serializer);
}
sitemapManager.release(serializerSelector);
}
} catch (ContextException ce) {
throw new CascadingIOException("Unable to get service manager.", ce);
}
}