cachedData = baos.toByteArray();
environment.setContentLength(cachedData.length);
os.write(cachedData);
} else {
CachingOutputStream os = new CachingOutputStream( environment.getOutputStream(this.outputBufferSize) );
// set the output stream
this.serializer.setOutputStream( os );
this.generator.generate();
cachedData = os.getContent();
}
} else {
this.generator.generate();
cachedData = (byte[])this.xmlSerializer.getSAXFragment();