code: @Override
  	public void close() throws IOException {
  		if (stream instanceof ByteArrayOutputStream) {
  			final byte[] bytes = ((ByteArrayOutputStream) stream).toByteArray();
  			response.getOutputStream().write(bytes);
  			stream = response.getOutputStream();
  		}
  		stream.close();
  	}
docs: {@inheritDoc}