Java Integer to Byte Array intToByteArray(int value, byte[] dest)

Here you can find the source of intToByteArray(int value, byte[] dest)

Description

int To Byte Array

License

Open Source License

Declaration

public static void intToByteArray(int value, byte[] dest) 

Method Source Code

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

public class Main {
    public static void intToByteArray(int value, byte[] dest) {
        int lastIndex = dest.length - 1;
        for (int i = lastIndex; i >= 0; i--) {
            dest[i] = (byte) (value & 0xff);
            value = value >> 8;/*from  w w  w . ja v a 2  s.c om*/
        }
    }
}

Related

  1. intToByteArray(int value)
  2. intToByteArray(int value)
  3. intToByteArray(int value)
  4. intToByteArray(int value, byte[] buffer, int offset)
  5. intToByteArray(int value, byte[] data, int offset)
  6. intToByteArray(int value, int nrOfBytes)
  7. intToByteArray(int value, int numBytes)
  8. intToByteArray2(final int integer)
  9. intToByteArray4(int i)