tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: How to get fields list in order
Date Thu, 02 Nov 2006 14:57:27 GMT
David,

> 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).

As Chuck points out, this is unlikely to work. If the JIT for the
platform decides to word-align your fields, and a word isn't 4-bytes
long, you will get the wrong data. There's probably no good way to do
this without a lot of trial and error followed by luck and an
environment that never changes.

At any rate, you'd better document the heck out of the whole thing ;)

-chris


Mime
View raw message