

Code: Select all
public static void main(String[] arguments) {
String sss = "string to byte stream";
byte[] byte_stream = sss.getBytes();
// send byte_stream to card
// do the transmit procession
// receive byte_steam from card ;
String recovery = new String(byte_stream);
System.out.println(recovery);
}
Code: Select all
case (byte)INS_SEND_RECV_APDU_1:
//Define a byte string
byte sendStr[] = {'A','P','D','U', ',', 'C','l','a','s','s', ',', 'D','e','m','o'};
short len = (short) sendStr.length;
//Copy character to APDU Buffer.
Util.arrayCopyNonAtomic(sendStr, (short)0, buf, (short)0, (short)len);
//Send the 'sendStr' string, the hex of JCRE sending data is the ASCII of sendStr.
apdu.setOutgoingAndSend((short)0, (short)len);
break;
Users browsing this forum: No registered users and 57 guests