Java Integer to Byte int2Byte(int intValue)

Here you can find the source of int2Byte(int intValue)

Description

int Byte

License

Apache License

Declaration

public static byte[] int2Byte(int intValue) 

Method Source Code

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

public class Main {

    public static byte[] int2Byte(int intValue) {
        byte[] b = new byte[4];
        for (int i = 0; i < 4; i++) {
            b[i] = (byte) (intValue >> 8 * (3 - i) & 0xFF);
            //System.out.print(Integer.toBinaryString(b[i])+" ");  
            //System.out.print((b[i] & 0xFF) + " ");  
        }// w  w w  .  j  a  v a2 s . co  m
        return b;
    }
}

Related

  1. int2bcdByte(int hRadix10, int lRadix10)
  2. int2bin(byte[] out, int offset, int i)
  3. int2byte(byte[] output, int[] input, int len)
  4. int2byte(final int i)
  5. int2byte(int i)
  6. int2byte(int ival, byte b[], int offset)
  7. int2byte(int value)
  8. int2byte(int[] ia)
  9. int2ByteArray(int i)