It sometimes is useful to reduce the clutter to get down to the essence of the problem. Assuming somebody is still interested in this topic please consider the following code:
It is helpful to read what the
Java Language Specification says about converting a byte to a char:
byte to char
First, the byte is converted to an int via widening primitive conversion, and then the resulting int is converted to a char by narrowing primitive conversion.
I hope the comments within the code explains what's going on.
(updated code - relative to b4)
[ October 07, 2006: Message edited by: Barry Gaunt ]
[ October 07, 2006: Message edited by: Barry Gaunt ]