class FastInfosetCompressorProcessor implements ResponseProcessor {

    @Override
    public byte[] process(final HttpServletRequest req, final HttpServletResponse resp, final byte[] responseBody) {
        ByteArrayInputStream inputStream = new ByteArrayInputStream(responseBody);
        byte[] result = responseBody;
        if (isFastInfoSetCompressionNeeded(req, resp)) {
            resp.setContentType(ACCEPT_VALUE_FASTINFOSET);
            result = compressResponseXmlToFastInfoset(inputStream);
        }

        return result;
    }

}