code: public static String readResource(String path) {
          final long start = System.nanoTime();
          try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) {
              int len = 0;
              byte[] buffer = new byte[2048];
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              while ((len = is.read(buffer)) >= 0) {
                  baos.write(buffer, 0, len);
              }
              return new String(baos.toByteArray(), StandardCharsets.UTF_8);
          } catch (IOException e) {
              LOGGER.log(Level.WARNING, e, () -> "IOException loading resource " + path);
              throw new IllegalStateException("Unable to read class loaded stream " + path, e);
          } catch (RuntimeException re) {
              LOGGER.log(Level.WARNING, re, () -> "Unexpected exception loading resource " + path);
              throw re;
          } finally {
              LOGGER.fine(() -> String.format("Loaded resource %s in %.3fms", path,
                      (System.nanoTime() - start) / 1000000.0));
          }
      }
docs: Load a resource stored in the classpath, as a String.
  
  @param path
  the system resource to read
  @return the resource as a String.