D
dog
Binary to ascii Question
I pick a JPG a.jpg
I read in it using ServletInputStream to a byte[] array
bytes are, of course, signed one byte things
So if you got through the array you get int values between -127 and 127
If you say
String s = new String(byteArray)
char[] x = s.toCharArray();
And then go through that away you get int values way above 256
Why?
Really just wondering. I would think it would translate each byte to the
unicode equal which is what I am trying to do. Okay that didn't work, but
what did it do? Anyeasy way to go from a JPG to unicode?
Do I add 128 to all the byte value of just knock of the sign? Or niether?
I pick a JPG a.jpg
I read in it using ServletInputStream to a byte[] array
bytes are, of course, signed one byte things
So if you got through the array you get int values between -127 and 127
If you say
String s = new String(byteArray)
char[] x = s.toCharArray();
And then go through that away you get int values way above 256
Why?
Really just wondering. I would think it would translate each byte to the
unicode equal which is what I am trying to do. Okay that didn't work, but
what did it do? Anyeasy way to go from a JPG to unicode?
Do I add 128 to all the byte value of just knock of the sign? Or niether?