Zip together the "a", "b" and "c" arrays until one of them runs out of values.
Each triple of values is combined into a single value using the supplied zipFunction function.

@param a
@param b
@return
183899
public static DoubleStream zip(final double[] a, final double[] b, final double[] c, final DoubleTriFunction<Double> zipFunction) {
        return Stream.zip(a, b, c, zipFunction).mapToDouble(ToDoubleFunction.UNBOX);
    }
869904
public static Map<String, String> zip(String keys, String values, String delimiter) {
		return zip(keys, values, delimiter, false);
	}
319326
public static <K, V> Multimap<K, V> zipToMap(List<K> keys, List<V> values)
    {
        if (keys.isEmpty() || values.isEmpty()) {
            return null;
        }

        Iterator<K> keyIter = keys.iterator();
        Iterator<V> valueIter = values.iterator();
        ArrayListMultimap<K, V> result = ArrayListMultimap.create();

        while (keyIter.hasNext() && valueIter.hasNext()) {
            result.put(keyIter.next(), valueIter.next());
        }

        // In case there are more values than keys, assign the rest of the
        // values to the first key
        K firstKey = keys.get(0);
        while (valueIter.hasNext()) {
            result.put(firstKey, valueIter.next());
        }

        return result;
    }
851294
static byte[] unzipForHeader( byte[] bs, int chkSize ) {

    ByteArrayInputStream bais = new ByteArrayInputStream(bs);
    ZipInputStream zis = new ZipInputStream(bais);

    InputStream is = zis;

    // Now read from the compressed stream
    int off = 0;

    try {
      while( off < bs.length ) {
        int len = 0;
        len = is.read(bs, off, bs.length - off);
        if( len < 0 )
          break;
        off += len;
        if( off == bs.length ) { // Dataset is uncompressing alot! Need more space...
          if( bs.length >= chkSize )
            break; // Already got enough
          bs = Arrays.copyOf(bs, bs.length * 2);
        }
      }
    } catch (IOException e) {
      e.printStackTrace();
    }

    try {
      is.close();
    } catch (IOException e) {
      e.printStackTrace();
    }

    return bs;
  }
602110
public static <T, R> Stream<R> zip(final Collection<? extends Stream<? extends T>> c, final Function<? super List<? extends T>, R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final List<Iterator<? extends T>> iterList = new ArrayList<>(len);

        for (Stream<? extends T> e : c) {
            iterList.add(e.iterator());
        }

        return zipp(iterList, zipFunction).onClose(newCloseHandler(c));
    }
882773
public static <R> Stream<R> zip(final FloatStream a, final FloatStream b, final FloatStream c, final FloatTriFunction<R> zipFunction) {
        return zip(a.iteratorEx(), b.iteratorEx(), c.iteratorEx(), zipFunction).onClose(newCloseHandler(N.asList(a, b, c)));
    }
226184
@SuppressWarnings("unchecked")
    public static <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4>[] zip(T1[] arr1, T2[] arr2, T3[] arr3, T4[] arr4) {
        int resultSize = _max(arr1.length, arr2.length, arr3.length, arr4.length);
        Tuple4[] result = new Tuple4[resultSize];

        for (int i = 0; i < resultSize; i++)
            result[i] = tuple(next(arr1, i), next(arr2, i), next(arr3, i), next(arr4, i));

        return result;
    }
380992
public static <R> Stream<R> zip(final float[] a, final float[] b, final float[] c, final FloatTriFunction<R> zipFunction) {
        return zip(FloatIteratorEx.of(a), FloatIteratorEx.of(b), FloatIteratorEx.of(c), zipFunction);
    }
4110
public static IntStream zip(final int[] a, final int[] b, final IntBiFunction<Integer> zipFunction) {
        return Stream.zip(a, b, zipFunction).mapToInt(ToIntFunction.UNBOX);
    }
830037
public static <A, B, C, R> Stream<R> zip(final Iterator<? extends A> a, final Iterator<? extends B> b, final Iterator<? extends C> c,
            final TriFunction<? super A, ? super B, ? super C, R> zipFunction) {
        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                return a.hasNext() && b.hasNext() && c.hasNext();
            }

            @Override
            public R next() {
                return zipFunction.apply(a.next(), b.next(), c.next());
            }
        });
    }
472196
@SuppressWarnings("resource")
    public static <R> Stream<R> zip(final Collection<? extends FloatStream> c, final FloatNFunction<R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final FloatIterator[] iters = new FloatIterator[len];
        int i = 0;

        for (FloatStream s : c) {
            iters[i++] = s.iteratorEx();
        }

        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                for (int i = 0; i < len; i++) {
                    if (iters[i].hasNext() == false) {
                        return false;
                    }
                }

                return true;
            }

            @Override
            public R next() {
                final float[] args = new float[len];

                for (int i = 0; i < len; i++) {
                    args[i] = iters[i].nextFloat();
                }

                return zipFunction.apply(args);
            }
        }).onClose(newCloseHandler(c));
    }
698691
function unzip (arrays) {
  var result = []
  var index = 0
  var len = XEUtils.max(arrays, function (item) {
    return item.length || 0
  }).length
  for (; index < len; index++) {
    result.push(arrayMap(arrays, index))
  }
  return result
}
317308
public static int[] concatArrays(int[] a, int[] b) {
        final int alen = a.length;
        final int blen = b.length;
        if (alen == 0) {
            return b;
        }
        if (blen == 0) {
            return a;
        }
        final int[] result = new int[alen + blen];
        arraycopy(a, 0, result, 0, alen);
        arraycopy(b, 0, result, alen, blen);
        return result;
    }
1053259
private static Integer[] mergeDocLists(Integer[] a, Integer[] b) {
    Integer[] answer = new Integer[a.length + b.length];
    int i = 0;
    int j = 0;
    int k = 0;
    Integer tmp;
    while (i < a.length && j < b.length) {
      tmp = a[i] < b[j] ? a[i++] : b[j++];
      for (; i < a.length && a[i].equals(tmp); i++)
        ;
      for (; j < b.length && b[j].equals(tmp); j++)
        ;
      answer[k++] = tmp;
    }
    while (i < a.length) {
      tmp = a[i++];
      for (; i < a.length && a[i].equals(tmp); i++)
        ;
      answer[k++] = tmp;
    }
    while (j < b.length) {
      tmp = b[j++];
      for (; j < b.length && b[j].equals(tmp); j++)
        ;
      answer[k++] = tmp;
    }
    return Arrays.copyOf(answer, k);
  }
1058795
public static byte[] add(byte[] b1, int off1, int len1, byte[] b2, int off2, int len2) {
		byte[] b = new byte[len1 + len2];
		System.arraycopy(b1, off1, b, 0, len1);
		System.arraycopy(b2, off2, b, len1, len2);
		return b;
	}
998882
def pairs(iterable):
    
    a, b = itertools.tee(iterable)
    next(b, None)
    return zip(a, b)
322605
@SuppressWarnings("resource")
    public static <R> Stream<R> zip(final Collection<? extends ByteStream> c, final ByteNFunction<R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final ByteIterator[] iters = new ByteIterator[len];
        int i = 0;

        for (ByteStream s : c) {
            iters[i++] = s.iteratorEx();
        }

        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                for (int i = 0; i < len; i++) {
                    if (iters[i].hasNext() == false) {
                        return false;
                    }
                }

                return true;
            }

            @Override
            public R next() {
                final byte[] args = new byte[len];

                for (int i = 0; i < len; i++) {
                    args[i] = iters[i].nextByte();
                }

                return zipFunction.apply(args);
            }
        }).onClose(newCloseHandler(c));
    }