Android Int to Byte Array Convert int2byte(int input)

Here you can find the source of int2byte(int input)

Description

intbyte

License

Open Source License

Declaration

public static byte[] int2byte(int input) 

Method Source Code

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

public class Main {

    public static byte[] int2byte(int input) {
        byte[] result = new byte[4];
        for (int i = 0;; i++) {
            if (i >= 4)
                return result;
            result[i] = (byte) (0xFF & input >> i * 8);
        }/*from  w  w w.j  ava 2  s.  c  o m*/
    }
}

Related

  1. int2Byte(int value)
  2. int2ByteArray(int value)
  3. int2ByteArray1(int value)
  4. int2ByteArray11(int value)
  5. int2ByteArray3(int value)
  6. int2byteWithInvert(int input)
  7. int2bytesBE(int val, byte[] b, int off)
  8. int2bytesLE(int val, byte[] b, int off)
  9. int2hex(int i)