Java Integer to Byte intToByte(int i_Value)

Here you can find the source of intToByte(int i_Value)

Description

int To Byte

License

Open Source License

Declaration

public static byte[] intToByte(int i_Value) 

Method Source Code

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

public class Main {

    public static byte[] intToByte(int i_Value) {
        byte[] v_Ret = new byte[4];

        v_Ret[0] = (byte) ((i_Value >>> 24) & 0xFF);
        v_Ret[1] = (byte) ((i_Value >>> 16) & 0xFF);
        v_Ret[2] = (byte) ((i_Value >>> 8) & 0xFF);
        v_Ret[3] = (byte) ((i_Value >>> 0) & 0xFF);

        return v_Ret;
    }/*  w  ww  .  j  a v a2s  .c  o  m*/
}

Related

  1. intToByte(final int i)
  2. intToByte(int i)
  3. IntToByte(int i)
  4. intToByte(int i)
  5. intToByte(int i)
  6. intToByte(int myInt)
  7. intToByte(int num)
  8. intToByte(int number)
  9. intToByte(int number)