Java Byte Array Create toByteArray(int[] array)

Here you can find the source of toByteArray(int[] array)

Description

to Byte Array

License

LGPL

Declaration

public static byte[] toByteArray(int[] array) 

Method Source Code

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

public class Main {
    public static byte[] toByteArray(int[] array) {
        byte[] data = new byte[array.length];
        for (int i = 0; i < array.length; i++) {
            data[i] = (byte) array[i];
        }//from ww w  . j  a  v  a 2 s .  co m
        return data;
    }
}

Related

  1. toByteArray(int value)
  2. toByteArray(int value)
  3. toByteArray(int value)
  4. toByteArray(int value)
  5. toByteArray(int value, int numBytes, byte[] dest, int off)
  6. toByteArray(int[] data)
  7. toByteArray(int[] data, boolean includeLength)
  8. toByteArray(long hi, long lo)
  9. toByteArray(Long mac)