Java Integer Convert To integerToASCII(int number)

Here you can find the source of integerToASCII(int number)

Description

integer To ASCII

License

Open Source License

Declaration

public static String integerToASCII(int number) 

Method Source Code

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

public class Main {
    public static String integerToASCII(int number) {

        char[] ascii = new char[8];
        ascii[0] = (char) (((number & 0xF0000000) >>> 28) + 97);
        ascii[1] = (char) (((number & 0x0F000000) >>> 24) + 97);
        ascii[2] = (char) (((number & 0x00F00000) >>> 20) + 97);
        ascii[3] = (char) (((number & 0x000F0000) >>> 16) + 97);
        ascii[4] = (char) (((number & 0x0000F000) >>> 12) + 97);
        ascii[5] = (char) (((number & 0x00000F00) >>> 8) + 97);
        ascii[6] = (char) (((number & 0x000000F0) >>> 4) + 97);
        ascii[7] = (char) (((number & 0x0000000F) >>> 0) + 97);

        for (int i = 0; i < 8; i++)
            System.err.println(ascii[i] - 97);

        return new String(ascii);

    }//from  w w  w. j  a va2  s  .  c om
}

Related

  1. fromIntLong(byte[] value)
  2. fromInts(int[] values)
  3. fromIntString(Object obj)
  4. fromIntWithPrefix(byte prefix, int v)
  5. IntegerTo(Integer i)
  6. integerToByte(int i)
  7. IntegerTochar(final Integer value)
  8. integerToFloat(float f, int i, float offset, boolean rotate)
  9. IntegerToInt(Integer[] in)