What types of variables can be passed with JNI?



I have an application whose purpose is to open, display and rezise TIFF
files.

My application is written mainly in Java, but it uses C/C++ through
JNI.

I purchased a OCR library which receives calls form the Java side using
_simple_ types of arguments such as int, floats and strings. For
instance, to have a file analized I just pass its filesystem path (i.e.
a string) to the C/C++ OCR library.

My next version has to provide some extended functionality and I wonder
if JNI is up to the task. More specifically, I would like to have
resizing features similar to those provided by Acrobat: click on a plus
sign and the image becomes bigger, type a percentage or move a sliding
tool and the images is resized.

After looking hard and long, it seems that the only libraries that can
perform that resampling with an acceptable level of quality and speed
are written in C/C++.

Now the question: as said above, I know I can pass an int or a string
between the Java side and the C/C++ side, but what about more complex
variables? Can I open a file in Java and pass some sort of handle to
it to the C library?

What are the limitations of JNI in terms of passing "objects" back &
forth?

TIA.

-Ramon F Herrera

.



Relevant Pages

  • Re: JNI: instace object C++ from Java
    ... primitive type as string or int. ... Not just primitives: you can pass *any* Java types (primitives or ... Objects) between Java and native code. ... No. JNI doesn't let you invoke arbitrary methods written in C or C++, ...
    (comp.lang.java.programmer)
  • Re: native interface
    ... Is it possible to call the functions of the c/c++ ... program from java with JNI interface. ... I just want to wrap the ... Addison-Wesley publishes the definitive JNI reference.. ...
    (comp.lang.java.programmer)
  • Re: Java on z/OS JNI Sample Wanted - Preferably HLASM
    ... "Java Stand Alone Applications on z/OS Volume II" ... JNI was originally designed to be used in combination with C/C++, ...
    (bit.listserv.ibm-main)
  • Re: native interface
    ... Is it possible to call the functions of the c/c++ ... program from java with JNI interface. ... I just want to wrap the ... Addison-Wesley publishes the definitive JNI reference. ...
    (comp.lang.java.programmer)
  • Re: [JNI] Catch Ctrl+Mouseclick on Windows?
    ... > not the case i think it is only possible using JNI. ... > of how to create my the .dll and do the communication with java. ... I would write a windows interface in C/C++ and run the java ...
    (comp.lang.java.programmer)