KR403 java sendAndWaitForResponse

// Expert user has replied.
P Plagnes Didier 3 years 7 months ago
10 1 0

Hello,
 
I am using sendAndWaitForResponse with java
 
byte[] message = usb.sendAndWaitForResponse("~HQES".getBytes(), 1000, 1000,null);
String test = "";
           for(int i= 0; i message.length;i++)
           {
               test = test + message[i];
           }
           System.out.println("HQES 1 : " + message.length + " ; " + test);
 
message.length is 132
test = 2131013103232808273788469823283846584858332323232323232323232323232323232323232323232323213103232326982827982835832323232323232323248324848484848484848324848484848484848323213103232328765827873787183583232323232323249324848484848484848324848484848485148323213103
 
How can I do for use this string ??
do you have java exemple ?
 
tanks very much
 
Didier

Please Register or Login to post a reply

1 Replies

G Gregory Pawlik

Hi Didier,

Please try the following:

byte[] message = usb.sendAndWaitForResponse("~HQES".getBytes(), 1000, 1000,null);
String test = new String(message, "UTF-8");
System.out.println("HQES 1 : " + message.length + " ; " + test);

Hope this helps,

Greg

CONTACT
Can’t find what you’re looking for?