mirror of https://github.com/kiwix/libkiwix.git
[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:
parent
9ab0f825f4
commit
2e60a088ab
|
@ -22,5 +22,5 @@ package org.kiwix.kiwixlib;
|
|||
public class Pair
|
||||
{
|
||||
public String filename;
|
||||
public int offset;
|
||||
public long offset;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue