public static byte @Nullable [] getResourceAsBytes(@NotNull String path,
                                                     @NotNull ClassLoader classLoader,
                                                     boolean checkParents) throws IOException {
    if (classLoader instanceof UrlClassLoader) {
      return ((UrlClassLoader)classLoader).getResourceAsBytes(path, checkParents);
    }

    InputStream stream = classLoader.getResourceAsStream(path);
    if (stream == null) {
      return null;
    }

    try (stream) {
      return stream.readAllBytes();
    }
  }
public static byte @Nullable [] getResourceAsBytes(@NotNull String path,
                                                     @NotNull ClassLoader classLoader,
                                                     boolean checkParents)