Binary to ASCII Question

From: dog (dawgwannabe_at_yahoo.com)
Date: 10/23/03


Date: Thu, 23 Oct 2003 15:44:17 -0500

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?



Relevant Pages

  • (patch for Bash) regex case statement
    ... Following up on my previous patch for regex conditional tests, ... /* Return an array of strings; ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: Strategy or Iterator?
    ... It would be possible to write a class that returns the variations ... GNU General Public License for more details. ... protected CombinatoricOperator(Telements, int r) { ... An integer array backing up the original one to keep track of the ...
    (comp.lang.java.programmer)
  • (patch for Bash) regex conditional tests
    ... 'regex' are returned in array variable SUBMATCH. ... Skipping of positional parameters, array elements, string ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: attempting an actual game...
    ... >>> and inflexible by the absurd decision to use a bit array for square ... as then one has 8 bits in which to store a color and a few flags ... Using a 2D int (or, ... > Change direction and you may eventually complete a game. ...
    (comp.games.development.programming.misc)
  • Re: Warning on assigning a function-returning-a-pointer-to-arrays
    ... This declares pfunc as a function taking no arguments and returning ... int x, y; ... Presumably pfuncwill return a pointer to a single int, ... or the first of a sequence of "array 5 of int"s. ...
    (comp.lang.c)

Loading