response.setContentLength((int)outputData.getStreamPosition());
// Now we may safely flush and close the output
// yes we really do need to flush it AND close it.
outputData.flushDelegate();
outputData.closeDelegate();
return Result.SUCCESS;
} finally {
// make sure we close these streams as they could be holding