Java Integer Array to Byte Array intArrayToByteArray(int[] data)

Here you can find the source of intArrayToByteArray(int[] data)

Description

unpack an array of ints into an array of bytes

License

Apache License

Declaration

public static byte[] intArrayToByteArray(int[] data) 

Method Source Code

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

public class Main {
    /** unpack an array of ints into an array of bytes */
    public static byte[] intArrayToByteArray(int[] data) {
        byte res[] = new byte[data.length];
        for (int i = 0; i < data.length; ++i) {
            res[i] = (byte) data[i];
        }//from ww w  . j a v  a 2s.c o m
        return res;
    }
}

Related

  1. convertIntArrayToByteArray(int[] data)
  2. convertIntArrayToByteArray(int[] myIntArray, int bytesPerInt)
  3. intArray2Bytes(int[] array)
  4. intArrayToByteArray(int[] ai)
  5. intArrayToByteArray(int[] ints)
  6. intArrayToBytes(int[] d)