Java Integer to Byte Array intToBytesBigend(int value)

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

Description

int To Bytes Bigend

License

Apache License

Declaration

public static byte[] intToBytesBigend(int value) 

Method Source Code

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

public class Main {
    public static byte[] intToBytesBigend(int value) {
        byte[] src = new byte[4];
        src[0] = (byte) ((value >> 24) & 0xFF);
        src[1] = (byte) ((value >> 16) & 0xFF);
        src[2] = (byte) ((value >> 8) & 0xFF);
        src[3] = (byte) (value & 0xFF);
        return src;
    }//from   w ww  . java2s  .  com
}

Related

  1. intToBytes(int value, byte[] buffer, int offset)
  2. intToBytes(int value, byte[] buffer, int offset, int length, boolean littleEndian)
  3. intToBytes16(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
  4. IntToBytes4(int i)
  5. intToBytesBE(int value, byte[] buffer)
  6. intToBytesBigEndian(int n)
  7. IntToBytesLE(final long val)
  8. intToBytesLE(int i, byte[] bytes, int off)
  9. intToBytesLE(int value, byte[] buffer, int offset, int length)