>>>>> "Jochen" == Jochen Hoenicke <[EMAIL PROTECTED]> writes:
>> With CNI a reference to gnu.gcj.RawData is used to hold data that
>> the native code needs. With JNI a reference to a byte[] is used. It
>> seems that a reference to RawData will not be touched by the
>> Garbage collector. I am not sure why that is necessary in this
>> case.
Jochen> This depends on the garbage collector. Some garbage collector
Jochen> may depend that all object fields point to real objects
Jochen> allocated with NewObject. I think many JVMs enforce that.
Jochen> With the byte[] I'm compatible but have a little bit more
Jochen> overhead.
In some cases the efficiency of using RawData might be important.
I don't have an example.
In this particular case using byte[] is probably fine.
Tom