public static NaiveCatBoostModel loadModel(InputStream fileStream) throws IOException {
    DataInputStream stream = new DataInputStream(new BufferedInputStream(fileStream));
    int[] floatFeaturesIndex = readIntArray(stream);
    int floatFeatureCount = stream.readInt();
    int binaryFeatureCount = stream.readInt();
    int treeCount = stream.readInt();
    ArrayList<double[]> floatFeatureBorders = readArrayList(stream, (s) -> {
      try {
        return readDoubleArray(s);
      }
      catch (IOException e) {
        throw new RuntimeException(e);
      }
    });
    int[] treeDepth = readIntArray(stream);
    int[] treeSplitBorder = readIntArray(stream);
    int[] treeSplitFeatureIndex = readIntArray(stream);
    int[] treeSplitXorMask = readIntArray(stream);
    double[] leafValues = readDoubleArray(stream);
    double scale = stream.readDouble();
    double bias = stream.readDouble();

    boolean predictProbability = stream.available() > 0 && stream.readBoolean(); // check eof for backward compatibility

    return new NaiveCatBoostModel(
      floatFeaturesIndex,
      floatFeatureCount,
      binaryFeatureCount,
      treeCount,
      floatFeatureBorders,
      treeDepth,
      treeSplitBorder,
      treeSplitFeatureIndex,
      treeSplitXorMask,
      leafValues,
      scale,
      bias,
      predictProbability
    );
  }
public static NaiveCatBoostModel loadModel(InputStream fileStream)