Re: Casting
dummy wrote:
Hello JavaGurus!
I need to cast byte[] to int.
It's like casting an eggbeater to an iron atom: it makes
no sense. Have you considered psychiatric counselling to
unearth the roots of this "need" of yours? Or, perhaps, are
you trying to (mis)use the tactics of one language in the
vastly different context of another?
Actually I need the addr of the byte[]-object.
How to get it?
Don't tell me "It's impossible", please.
All right, I won't: it's not impossible, just very
laborious. You'll need to write your own JVM -- it won't
be a true "Java Virtual Machine" because it will expose
things like addresses that a real JVM will not, but your
JVM-Plus can do whatever you care to make it do.
If you only need the addresses of a few byte[] objects
rather than many, it might be more expedient to run a real
JVM under a debugger and use breakpoints and watchpoints
and so on.
(I'm ready to modify .class-file)
Won't help. You need to get at the JVM internals.
--
Eric Sosman
esosman@ieee-dot-org.invalid