code: protected Response streamResponse(byte[] data, String type) {
      try (InputStream byteStream = new ByteArrayInputStream(data)) {
        return streamResponse(type, byteStream, data.length);
      } catch (IOException e) {
        logger.error("Failed to stream data to client", e);
        return createInternalServerError("Failed to stream data to client");
      }
    }
docs: Creates streamed response from byte array
  
  @param data data
  @param type content type
  @return Response