Java Integer to Byte Array integerToBytes(int value)

Here you can find the source of integerToBytes(int value)

Description

integer To Bytes

License

Open Source License

Declaration

public static byte[] integerToBytes(int value) 

Method Source Code

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

public class Main {
    public static byte[] integerToBytes(int value) {
        return new byte[] { (byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) value };
    }/*  w  ww  .j  a  va2s  .  co  m*/
}

Related

  1. integerToByteArray(int a, byte[] buf)
  2. integerToByteArray(int value)
  3. IntegerToBytes(int i, byte[] dst, int offset)
  4. integerToBytes(int v, byte[] b)
  5. integerToBytes(int v, byte[] b)
  6. integerToBytes(int x)
  7. intTo2Bytes(int x)
  8. intTo4ByteArray(int value)
  9. intTo4Bytes(int i)