Java Integer to intToBigEndianByteArray(int in)

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

Description

int To Big Endian Byte Array

License

Apache License

Declaration

public static byte[] intToBigEndianByteArray(int in) 

Method Source Code

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

public class Main {
    public static byte[] intToBigEndianByteArray(int in) {
        return new byte[] { (byte) ((in >> 24) & 0xFF), (byte) ((in >> 16) & 0xFF), (byte) ((in >> 8) & 0xFF),
                (byte) (in & 0xFF) };
    }/*  w  w  w  . j  a  v  a2 s  . c o  m*/
}

Related

  1. intToASN1(byte[] d, int idx, int val)
  2. intToBase32(int n)
  3. intToBasicType(int i, Class clazz)
  4. intToBcd(int src, int len, int flag)
  5. intToBigEndian(int value, byte[] array, int index)
  6. intToBlue(int color)
  7. IntToBuf2BE(int val, byte[] buf, int offset)
  8. intToBuffer(int i, byte[] ioBuffer)
  9. intToCodeString(int value)