How to get address of a memory area

Hi, I want to pass as argument, the address of a byte array. Something like:static byte[] MyBuffer;NewAddr = adressof(MyBuffer)NewAddr[1] = (same as MyBuffer[1])Thanks... :-)
[209 byte] By [davendaa] at [2007-11-27 8:43:16]
# 1

As far as I know, Java (and Java Card) does not allow direct addressing of memory. However, the objects you pass around are simply references, so simply doing

byte[] NewAddr = MyBuffer;

should do the trick.

I dunno if this is sufficient for your needs, but I think it's the only way.

Lillesanda at 2007-7-12 20:42:53 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2
Review the JCRE/JCVM specification. No, you can't access card memory. That would defeat 1) The purpose of JC layer 2) card securityRemeber JC is a small abstract of Java. Hence, if it can't be done in Java, it can't be done in JC !
Joseph.Smitha at 2007-7-12 20:42:53 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3
Thanks Lillesand...It worked...But have you a suggestion to this:- BUF1[] = 46 bytes array- Want to set BUF2 to BUF1[20] so that I can access BUF1[20] with this line:x = BUF2[0] ;// Which is the same physical memory byte as BUF1[20];-)
davendaa at 2007-7-12 20:42:53 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 4
As far as I know, that is not possible in Java...
Lillesanda at 2007-7-12 20:42:53 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 5
Thanks
davendaa at 2007-7-12 20:42:53 > top of Java-index,Java Mobility Forums,Consumer and Commerce...