code: public static Action bytesContent(final byte[] content) {
          return new Action(response -> {
  
              response.setContentLength(content.length);
              try {
                  response.getOutputStream().write(content);
              } catch (IOException e) {
                  throw new RuntimeException("Can not write resource content for restito stubbing.");
              }
              return response;
          });
      }
docs: Writes bytes content to response