Java Integer to int2ba(int integer)

Here you can find the source of int2ba(int integer)

Description

intba

License

Open Source License

Declaration

public static Byte[] int2ba(int integer) 

Method Source Code

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

public class Main {
    public static Byte[] int2ba(int integer) {
        Byte[] result = new Byte[4];

        result[0] = (byte) ((integer & 0xFF000000) >> 24);
        result[1] = (byte) ((integer & 0x00FF0000) >> 16);
        result[2] = (byte) ((integer & 0x0000FF00) >> 8);
        result[3] = (byte) (integer & 0x000000FF);

        return result;
    }/*from  w w  w  .  jav  a 2 s .c o m*/
}

Related

  1. int2(final int x)
  2. int2(StringBuilder buf, int i)
  3. int2ABC(int index)
  4. int2array(int sz, int seed)
  5. int2BigEndianStr(int i)
  6. int2buff(int n)
  7. int2Char(int i)
  8. int2Date(Integer date, String interval)