code: public void downloadByteData(ResponseDownloadResource resource, HttpServletResponse response) {
          final byte[] byteData = resource.getByteData();
          if (byteData == null) {
              String msg = "Either byte data or input stream is required: " + resource;
              throw new IllegalArgumentException(msg);
          }
          try {
              final OutputStream out = response.getOutputStream();
              try {
                  out.write(byteData);
              } finally {
                  closeDownloadStream(out);
              }
          } catch (RuntimeException e) {
              throw new ResponseDownloadFailureException("Failed to download the byte data: " + resource, e);
          } catch (IOException e) {
              handleDownloadIOException(resource, e);
          }
      }
docs: =========