Java Integer to Byte int2ByteArray(int i)

Here you can find the source of int2ByteArray(int i)

Description

int Byte Array

License

Apache License

Declaration

public static byte[] int2ByteArray(int i) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static byte[] int2ByteArray(int i) {
        byte[] result = new byte[4];
        result[0] = (byte) ((i >> 24) & 0xFF);
        result[1] = (byte) ((i >> 16) & 0xFF);
        result[2] = (byte) ((i >> 8) & 0xFF);
        result[3] = (byte) (i & 0xFF);

        return result;
    }// w w w .ja  v  a2s .  com
}

Related

  1. int2byte(int i)
  2. int2Byte(int intValue)
  3. int2byte(int ival, byte b[], int offset)
  4. int2byte(int value)
  5. int2byte(int[] ia)
  6. int2byteArray(int k, byte b[], int off)
  7. int2ByteArray(int value)
  8. int2byteArray(int[] i)
  9. int2ByteArrayLength4(int theInt)