[JAVA] Use a long to store the offset of a article in the zim file.

Fixes kiwix/kiwix-android#1769
This commit is contained in:
Matthieu Gautier 2020-02-19 14:27:51 +01:00
parent 9ab0f825f4
commit 2e60a088ab
2 changed files with 4 additions and 4 deletions

View File

@ -22,5 +22,5 @@ package org.kiwix.kiwixlib;
public class Pair
{
public String filename;
public int offset;
public long offset;
}

View File

@ -258,14 +258,14 @@ inline void setBoolObjValue(const bool value, const jobject obj, JNIEnv* env)
env->SetIntField(obj, objFid, c2jni(value, env));
}
inline void setPairObjValue(const std::string& filename, const int offset,
inline void setPairObjValue(const std::string& filename, const long offset,
const jobject obj, JNIEnv* env)
{
jclass objClass = env->GetObjectClass(obj);
jfieldID filenameFid = env->GetFieldID(objClass, "filename", "Ljava/lang/String;");
env->SetObjectField(obj, filenameFid, c2jni(filename, env));
jfieldID offsetFid = env->GetFieldID(objClass, "offset", "I");
env->SetIntField(obj, offsetFid, offset);
jfieldID offsetFid = env->GetFieldID(objClass, "offset", "J");
env->SetLongField(obj, offsetFid, offset);
}
#endif // _ANDROID_JNI_UTILS_H