static byte[] byteArrayFromShorts_littleEndian(short[] a) { ret byteArrayFromShorts_littleEndian(a, 0, l(a)); } static byte[] byteArrayFromShorts_littleEndian(short[] a, int from, int to) { byte[] b = new byte[(to-from)*2]; for (int i = 0; i < a.length; i++) { short s = a[from+i]; b[i*2] = (byte) s; b[i*2+1] = (byte) (s >> 8); } ret b; }