code: public static void sendFileToHttpServiceResponse(String fileName, Object bodyObj, HttpServletResponse res) {
  
          if (fileName == null || bodyObj == null) {
              return;
          }
  
          String body = null;
          try {
              body = ValidationObjUtil.getDefaultObjectMapper().writeValueAsString(bodyObj);
          } catch (JsonProcessingException e) {
              log.info(e.getMessage());
          }
  
          String filename = getEncodingFileName(fileName);
          initFileSendHeader(res, filename, null);
  
          byte[] bytes = body.getBytes();
          res.setContentLength(bytes.length);
          try {
              res.getOutputStream().write(bytes);
          } catch (IOException e) {
              throw new ValidationLibException("file io error :" + e.getMessage());
          }
      }
docs: Send file to http service response.
  
  @param fileName the file name
  @param bodyObj  the body obj
  @param res      the res