diff --git a/lib/src/main/cpp/libkiwix/illustration.cpp b/lib/src/main/cpp/libkiwix/illustration.cpp index 78ede04..f1830c2 100644 --- a/lib/src/main/cpp/libkiwix/illustration.cpp +++ b/lib/src/main/cpp/libkiwix/illustration.cpp @@ -50,4 +50,7 @@ METHOD0(jstring, url) { return TO_JNI(THIS->url); } CATCH_EXCEPTION(nullptr) -GETTER(jstring, getData) +METHOD0(jbyteArray, getData) { + auto data = THIS->getData(); + return cArray2jni(data->c_str(), data->size(), env) +} CATCH_EXCEPTION(nullptr) diff --git a/lib/src/main/java/org/kiwix/libkiwix/Illustration.java b/lib/src/main/java/org/kiwix/libkiwix/Illustration.java index 771a4e2..98b4af5 100644 --- a/lib/src/main/java/org/kiwix/libkiwix/Illustration.java +++ b/lib/src/main/java/org/kiwix/libkiwix/Illustration.java @@ -8,7 +8,7 @@ public class Illustration public native String mimeType(); public native String url(); - public native String getData(); + public native byte[] getData(); @Override protected void finalize() { dispose(); }