private void writeResponse(HttpServletResponse response, byte[] data) throws IOException {
private void writeResponse(HttpServletResponse response, String data, String encoding) throws IOException {    String contentType = response.getContentType(); if ( contentType != null && !response.isCommitted() ) {  int semicolon = contentType.indexOf(';'); if (semicolon != Constants.STRING_NOT_FOUND) { contentType = contentType.substring(0,semicolon); }  response.setContentType(contentType + "; charset=" + encoding); }
    private void writeResponse(HttpServletResponse response, byte[] data)    throws IOException {        OutputStream is = response.getOutputStream();        is.write(data);    }