Java Integer to Byte intToByte(int number)

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

Description

int To Byte

License

Apache License

Declaration

public static byte[] intToByte(int number) 

Method Source Code

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

public class Main {

    public static byte[] intToByte(int number) {
        byte[] b = new byte[4];
        for (int i = 3; i >= 0; i--) {
            b[i] = (byte) (number % 256);
            number >>= 8;//from   ww  w .  j  ava  2 s.  c  om
        }
        return b;
    }
}

Related

  1. intToByte(int i)
  2. intToByte(int i_Value)
  3. intToByte(int myInt)
  4. intToByte(int num)
  5. intToByte(int number)
  6. intToByte(int number, int byteLength)
  7. intToByte(int v, byte[] dest)
  8. intToByte(int value)
  9. intToByte(int value)