Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

int to byte[] ?

843851Jul 7 2010 — edited Jul 8 2010
Hi,

I'm "playing and learning" with JavaCard 2.2.1

But, I need a problem with a "studpid thing".

I want that my Applet has a int. for example:
int myInt=100;
And after I will send this variable, But I only know send bytes. I do:
        //out is a byte[]

	private void mySend(APDU apdu) {
		byte[] buffer = apdu.getBuffer();	
		apdu.setOutgoing();
		short totalBytes = (short) out.length;
		apdu.setOutgoingLength(totalBytes);
		apdu.sendBytesLong(out, (short) 0, (short) out.length);
        }
How can send an int variable?
or in other words, how can convert int to byte[]?

Thanks!!

Ah! I have another doubt: What IDE use you for programming by JavaCard 2.2.1?


Thanks!!!


Martí
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2010
Added on Jul 7 2010
5 comments
258 views