Java Integer to Byte Array int2bytes(int num)

Here you can find the source of int2bytes(int num)

Description

intbytes

License

Apache License

Declaration

public static byte[] int2bytes(int num) 

Method Source Code

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

public class Main {
    public static byte[] int2bytes(int num) {
        byte[] bytes = new byte[] { (byte) (num >> 24), (byte) (num >> 16), (byte) (num >> 8), (byte) (num) };

        return bytes;
    }//from   ww  w. java2  s.  c o m
}

Related

  1. int2bytes(int integer)
  2. int2bytes(int intValue)
  3. int2Bytes(int l, byte[] target, int offset)
  4. int2Bytes(int n, byte[] dst, int start)
  5. int2Bytes(int num)
  6. int2Bytes(int num)
  7. int2bytes(int num)
  8. int2bytes(int num, int len)
  9. int2bytes(int v)