java decmail string to AS 3.0 conversion procedure

Posted by Jack Smith on Stack Overflow See other posts from Stack Overflow or by Jack Smith
Published on 2010-04-16T08:57:34Z Indexed on 2010/04/16 9:03 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

Hello, I have a problem with conversion java code to action script 3. Anyone can help with code translation? Thanks.

public static short[] decmail_str_to_binary_data(String s) {

            short[] data = new short[s.length()/2];

              for (int i = 0; i < s.length(); i += 2)
                     {
                             char c1 = s.charAt(i);
                             char c2 = s.charAt(i + 1);

                             int comb = Character.digit(c1, 16) & 0xff;
                             comb <<= 4;
                             comb += Character.digit(c2, 16) & 0xff;
                             data[i/2] = (short)comb;
                     }
              return data;

}

© Stack Overflow or respective owner

Related posts about java

Related posts about action