I have a String like this in my Java code.
String my = "16 12 12 -119 102 105 -110 52 -89 80 -122 -68 114 20 -92 -28 -121 38 113 61"
the values separated by " " is integer ( you can see it ).
I can convert the integers to a int array, but I need to convert the int values to a byte array. The value represented by each integer is a byte value.
PS.
String aa[] = U.split(" ");
byte bb[] = new byte[aa.length];
for(int q=0;q<aa.length;q++){
int v = Integer.parseInt(aa[q]);
bb[q] = ???????????????????--the code I need to convert the int to a byte
}
intarray? Chances are you could skip that and convert them straight to bytes. Please show your code so far. (If you do need to convert theint[]tobyte[], you can just create a new array and convert each value in turn, with aforloop. Again - what have you tried?java.lang.Integer-class why not look atjava.lang.Byteas well?