Esempio n. 1
0
  public static byte[] concatByteArrays(byte[] first, byte[]... remaining) {
    int length = first.length;
    for (byte[] array : remaining) {
      length += array.length;
    }

    byte[] result = new byte[length];
    System.arraycopy(first, 0, result, 0, first.length);
    int offset = first.length;

    for (byte[] array : remaining) {
      System.arraycopy(array, 0, result, offset, array.length);
      offset += array.length;
    }

    return result;
  }