Java ASCII ASCIIToInteger(String ascii)

Here you can find the source of ASCIIToInteger(String ascii)

Description

ASCII To Integer

License

Open Source License

Declaration

public static int ASCIIToInteger(String ascii) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int ASCIIToInteger(String ascii) {

        long number = (ascii.charAt(0) - 97 << 28)
                | ((ascii.charAt(1) - 97) << 24)
                | ((ascii.charAt(2) - 97) << 20)
                | ((ascii.charAt(3) - 97) << 16)
                | ((ascii.charAt(4) - 97) << 12)
                | ((ascii.charAt(5) - 97) << 8)
                | ((ascii.charAt(6) - 97) << 4) | ((ascii.charAt(7) - 97));

        return (int) number;

    }/*from   w  w w .ja  v a2 s . c  o  m*/
}

Related

  1. asciiString(byte[] bytes, int from, int count)
  2. asciiString(String fourcc)
  3. AsciiStringToString(String content)
  4. asciiToBCD(byte[] ascii, int asc_len)
  5. asciiToEbcdic(String s)
  6. asciiValue(byte b)