Do not put binary illustration data into a string.

Java String must contains utf8 content.
Illusration data which is PNG is definitively not a utf8 string.

Fix #73
This commit is contained in:
Matthieu Gautier 2023-11-09 14:19:33 +01:00 committed by Kelson
parent 853233ae37
commit 1cbbd4eaa5
2 changed files with 5 additions and 2 deletions

View File

@ -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.data(), data.size(), env);
} CATCH_EXCEPTION(nullptr)

View File

@ -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(); }