Java Byte Array Create toBytes(int[] ints)

Here you can find the source of toBytes(int[] ints)

Description

to Bytes

License

Open Source License

Declaration

public static final byte[] toBytes(int[] ints) 

Method Source Code

//package com.java2s;

public class Main {

    public static final byte[] toBytes(int[] ints) {
        if (ints == null) {
            return null;
        }//from w ww.j a v  a 2  s  . c  o m

        byte[] data = new byte[ints.length];
        for (int i = 0; i < ints.length; i++) {
            data[i] = (byte) ints[i];
        }

        return data;
    }
}

Related

  1. toBytes(int value)
  2. toBytes(int value)
  3. toBytes(int value)
  4. toBytes(int value, byte[] dest, int destPos)
  5. toBytes(int x, byte[] out)
  6. toBytes(long input)
  7. toBytes(long l)
  8. toBytes(long l, byte[] bytes, int offset, int limit)
  9. toBytes(long lp)