-1

I have an array of Bytes. How do I concatenate them? E.g.

Byte mem[] = new Byte[4];
mem[0] = aa;
mem[1] = bb;
mem[2] = cc;
mem[3] = 00;

I want to return one hexadecimal number: aabbcc00

Jeff
  • 21
  • 1
  • 4

1 Answers1

0
Byte mem[] = new Byte[4];
mem[0] = aa;
mem[1] = bb;
mem[2] = cc;
mem[3] = 00;
for(int i=0; i<4; i++)
  {
     System.out.print(mem[i]);
  }

You can use this for loop to get ouput aabbcc00.