Here you can find the source of toByteArrayFromPositiveInts(int[] inInts)
public static byte[] toByteArrayFromPositiveInts(int[] inInts)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] toByteArrayFromPositiveInts(int[] inInts) { if (inInts == null) { return null; }/*from ww w . j av a 2 s . c o m*/ final byte[] theBytes = new byte[inInts.length]; for (int i = 0; i < theBytes.length; i++) { theBytes[i] = positiveIntToByte(inInts[i]); } return theBytes; } public static byte positiveIntToByte(int inInt) { return (byte) (inInt - 128); } }