I have tried and tested this code with 8 bit data and it works like a charm! Thanks devs for this amazing library.
There is a bug with JNI. It cannot use "export" methods defined at different places in the same dll. interface.cpp already has exported functions. If I add another file (JNIinterface.cpp say) and export some more functions for my java code, they
are not detected.
There are 2 possible work arounds for this:
1. create a separate C++ project that takes CharLS.dll as a references library. You'll have to include two dll files in your java path; CharLS.dll and YourProject.dll
2. Add your JNI methods to interface.cpp itself. This is what I did because of its obvious simplicity. For the purpose of sharing I can send you separate cpp files with my JNI glue code but ultimately the user will have to choose one of the two methods.
My JNI code will also be supplemented by the Java declaration of those methods, which should be a part of the Java code. I can write all of this in a bit of detail if you wish. Let me know how you would like me to share the code ?