I am trying to do the lesson on FileIO.
Data comes in as byte streams, where bytes have 8 bits.
I want to be able to convert between byte, int and char.
What operators, type casting or methods can I use?
ie I want to work on a byte array, treating individual bytes as
characters and then pushing them back into the array.
if I have the code:
InputStream in;
byte [] b;
int len;
len = in.read(b, 0, b.length); //read len bytes into array b
how do I then convert the byte array into char, int or String array
then manipulate it ie convert to upper case eg (for ....) c[i] =
toUpperCase(c[i]);
then push it back into the original byte array?
Can I "point" at the 8bit byte array b[] using a 16bit character array
c[] ?
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en