public void doFilter(final HttpServletRequest request, final HttpServletResponse response, final FilterChain chain) throws IOException, ServletException {
CachedHttpServletResponse responseWrapper = new CachedHttpServletResponse(response);
chain.doFilter(request, responseWrapper);
CachedServletOutputStream wrapper = (CachedServletOutputStream) responseWrapper.getOutputStream();
InputStream cache = wrapper.getInputStream();
String text = IOUtils.toString(cache, this.charsetFrom);
String content = this.charsetTransform.transform(text);
response.getOutputStream().write(content.getBytes());
}