code: public static ModelLoader load(InputStream stream) throws IOException {
          JsonNode tree = MAPPER.readTree(stream);
          JsonNode version = tree.get("FormatVersion");
          if (version == null || !version.isObject()) {
              throw new IllegalStateException("No FormatVersion found");
          }
  
          JsonNode major = version.get("Major");
          if (major == null || !major.isNumber()) {
              throw new IllegalStateException("No Major version found");
          }
  
          int majorVersion = major.asInt();
  
          switch (majorVersion) {
          case 1:
              return new ModelLoader(loadV1Model(tree, version));
  
          default:
              throw new IllegalStateException(
                      "Unknown major version " + majorVersion + ". Perhaps "
                      + "you need a newer version of the resources runtime?");
          }
      }
docs: Loads a model from an arbitrary {@code InputStream}.