private ServletRequest wrapDeflatedRequest(HttpServletRequest request) throws IOException {
final Deflater deflater = buildDeflater();
final DeflaterInputStream input = new DeflaterInputStream(request.getInputStream(), deflater, _bufferSize) {
@Override
public void close() throws IOException {
deflater.reset();
localDeflater.set(deflater);
super.close();
}
};
return new WrappedServletRequest(request, input);