Here you can find the source of toBytes(int[] ints)
public static final byte[] toBytes(int[] ints)
//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; } }