I am not familiar with Java syntax, that question is very stupid.
My goal in C is very simple:
char a[3] = {1, 12, 115};
for{int i = 0; i< 3; i++}
printf("%1d", (unsigned int)a[i]);
or
char str[256];
memset(&str[0], 0, 256);
for(int i = 0; i<3; i++){
int ii;
ii = strlen(&str[0]);
sprintf(&str[ii], "%1u", (unsigned int)a[i]);
}/*for*/
printf("%s", &str[0]);
The print result be 112115
if I would like to use hexadecimal
it is just replace
sprintf(&str[0], "%1u", (unsigned int)a[i]);
as
sprintf(&str[0], "%#1x", (unsigned int)a[i]);
In java, I met a trouble for the same purpose.
There is a byte[] , I would like to convert it as number array, but I did not get a explicit way to achieve the goal .
I found a way there is :
String str = new String("");
byte[] a = {1, 12, 115};
for(int i = 0; i< 3; i++){
str += Integer.toString(a[i].intValue());
}
That looks like clumsy.
Could anyone give me suggestion ? thank you.