Caldarale, Charles R wrote:
From: David Kerber [mailto:[EMAIL PROTECTED]
Subject: Re: How to get fields list in order
To modify return parameters, I need the byte offsets of
the various pieces of the structure, which I'm mirroring
in my java classes.
That's a very scary way to do it. Using order to determine byte offsets
is not reliable, since that can change from JVM to JVM and across
different platforms and CPU architectures. What's wrong with gettng the
field IDs during class initialization and using the GetField / PutField
JNI methods as needed?
That's my workaround, but it's a lot more work than being able to search
a fields list, as long as the fields list could be retreived in the
order it was declared. Then I could just check the field type, and
increment the byte counter by the appropriate amount (i.e. if the java
field type is int, then I know the width in the passed structure is 4
bytes, etc). I'm not looking for the byte offsets into the java classes
themselves, but rather am using them as indexes into the passed
structure, for which the byte offsets ARE fixed, but could change if we
need to modify them later on.
Dave
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]