Here you can find the source of intsToBytes(int[] values)
public static byte[] intsToBytes(int[] values)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] intsToBytes(int[] values) { byte[] ret = new byte[values.length]; for (int k = 0, len = values.length; k < len; k++) ret[k] = (byte) values[k]; return ret; }//from w w w .j a v a 2s . c o m }