Sending 250 bytes length data with an apdu command
Hi,
I'm trying to send an apdu command with data field length bigger than 128 bytes. I'm using the following code to put the data field length in the apdu command.
apduCommand[OFFSET_LC] = Byte.parseByte(Integer.toHexString(p.length),16);
Using this I got a number format exception. Have you an idea ?
Regards
[342 byte] By [
Darwiina] at [2007-11-27 11:23:34]

# 2
> Use simple casting instead:
> apduCommand[OFFSET_LC] = (byte) p.length;
Hi,
Thanks for your answer. I've tried the simple casting but steels the Java.lang.NumberFormatException.
Message was edited by:
Darwiin
# 3
Strange, it worked for me when I tried
System.out.println((byte) 250);
I'm pretty sure you're doing something else wrong, as NumberFormatExceptions are thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format."