A good guide to to to convert from one java data type to another can be found at http://mindprod.com/converter.html.
For going int -> String, the following alternatives are suggested:// to String g from int i
/* best for readabilty */ g = Integer.toString(i);
/* best for maintainablity */ g = String.valueOf(i);
/* or */ g = Integer.toString(i, 7 /* radix */);
/* or */ g = Integer.toBinaryString(i);
/* or */ g = Integer.toOctalString(i);
/* or */ g = Integer.toHexString(i);
/* or kludgy and possibly slow */ g = "" + i;
Tacking .getBytes() as suggested above onto the end of any of the alternatives above will give you the desired char array. Thus:// to byte[] ba from int i
ba = Integer.toString(i).getBytes();
ba = String.valueOf(i).getBytes();
ba = Integer.toString(i, 7).getBytes();
ba = Integer.toBinaryString(i).getBytes();
ba = Integer.toOctalString(i).getBytes();
ba = Integer.toHexString(i).getBytes();
ba = ("" + i).getBytes();
(I think there should be enough information above to help work out the (slightly more complex) reverse conversion for yourself.)
Vince.