Java Integer to Byte int2byte(int[] ia)

Here you can find the source of int2byte(int[] ia)

Description

intbyte

License

Open Source License

Declaration

public static byte[] int2byte(int[] ia) 

Method Source Code

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

public class Main {
    public static byte[] int2byte(int[] ia) {
        int length = ia.length;
        byte[] ba = new byte[length * 4];
        for (int i = 0, j = 0, k; i < length;) {
            k = ia[i++];/*from  w  ww . ja v a 2 s. c o m*/
            ba[j++] = (byte) ((k >>> 24) & 0xFF);
            ba[j++] = (byte) ((k >>> 16) & 0xFF);
            ba[j++] = (byte) ((k >>> 8) & 0xFF);
            ba[j++] = (byte) (k & 0xFF);
        }
        return (ba);
    }
}

Related

  1. int2byte(final int i)
  2. int2byte(int i)
  3. int2Byte(int intValue)
  4. int2byte(int ival, byte b[], int offset)
  5. int2byte(int value)
  6. int2ByteArray(int i)
  7. int2byteArray(int k, byte b[], int off)
  8. int2ByteArray(int value)
  9. int2byteArray(int[] i)