Java Convert via ByteBuffer intToByte(int[] intArray)

Here you can find the source of intToByte(int[] intArray)

Description

int To Byte

License

Open Source License

Declaration

public static byte[] intToByte(int[] intArray) 

Method Source Code

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

import java.nio.ByteBuffer;

import java.nio.IntBuffer;

public class Main {
    public static byte[] intToByte(int[] intArray) {
        ByteBuffer byteBuffer = ByteBuffer.allocate(intArray.length * 4);
        IntBuffer intBuffer = byteBuffer.asIntBuffer();
        intBuffer.put(intArray);//from   w  w  w.j  a v a  2 s.c  o  m
        byte[] array = byteBuffer.array();
        return array;
    }
}

Related

  1. intArrayToByteArray(int[] intArray)
  2. intArrayToBytes(Collection values)
  3. intArrayToIntBuffer(int[] data)
  4. intsToBytes(int[] n)
  5. IntToBArray(int src)
  6. intToByteArray(int integer)
  7. intToByteArray(int l)
  8. intToByteArray(int number)
  9. intToByteArray(int someInt, int byteSize)