JNIEXPORT jlong JNICALL Java_com_uber_h3core_NativeMethods_uncompactCellsSize()

in src/main/c/h3-java/src/jniapi.c [905:924]


JNIEXPORT jlong JNICALL Java_com_uber_h3core_NativeMethods_uncompactCellsSize(
    JNIEnv *env, jobject thiz, jlongArray h3, jint res) {
    jsize numHexes = (**env).GetArrayLength(env, h3);
    jlong *h3Elements = (**env).GetLongArrayElements(env, h3, 0);

    if (h3Elements != NULL) {
        jlong sz;
        H3Error err = uncompactCellsSize(h3Elements, numHexes, res, &sz);

        (**env).ReleaseLongArrayElements(env, h3, h3Elements, 0);

        if (err) {
            ThrowH3Exception(env, err);
        }
        return sz;
    } else {
        ThrowOutOfMemoryError(env);
        return 0;
    }
}