class ServletContainerResponseWriter implements ContainerResponseWriter {

    @Override
    @SuppressWarnings({"unchecked"})
    public void writeBody(GenericContainerResponse response, MessageBodyWriter entityWriter) throws IOException {
        if (servletResponse.isCommitted()) {
            return;
        }
        Object entity = response.getEntity();
        if (entity != null) {
            OutputStream out = servletResponse.getOutputStream();
            entityWriter.writeTo(entity, entity.getClass(), response.getEntityType(), null, response.getContentType(),
                                 response.getHttpHeaders(), out);
            out.flush();
        }
    }

    public  ServletContainerResponseWriter(HttpServletResponse response);

}