Android Int to Byte Array Convert intToBytes(int in)

Here you can find the source of intToBytes(int in)

Description

int To Bytes

License

Open Source License

Declaration

public static byte[] intToBytes(int in) 

Method Source Code

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

public class Main {
    public static byte[] intToBytes(int in) {
        byte[] b;
        b = new byte[] { (byte) (in >>> 24 & 0xFF),
                (byte) (in >>> 16 & 0xFF), (byte) (in >>> 8 & 0xFF),
                (byte) (in >>> 0 & 0xFF) };
        return b;
    }/*  w w w .  jav a 2  s .c  om*/
}

Related

  1. intToByte(int number)
  2. intToByteArray(int a)
  3. intToByteArray(int i)
  4. intToByteArray(int value)
  5. intToBytes(int i)
  6. intToBytes(int n)
  7. intToBytes(int number)
  8. intToBytes(int x)
  9. toBytes(int value)