code: public static ByteBuf copiedBuffer(byte[]... arrays) {
          switch (arrays.length) {
          case 0:
              return EMPTY_BUFFER;
          case 1:
              if (arrays[0].length == 0) {
                  return EMPTY_BUFFER;
              } else {
                  return copiedBuffer(arrays[0]);
              }
          }
  
          // Merge the specified arrays into one array.
          int length = 0;
          for (byte[] a: arrays) {
              if (Integer.MAX_VALUE - length < a.length) {
                  throw new IllegalArgumentException(
                          "The total length of the specified arrays is too big.");
              }
              length += a.length;
          }
  
          if (length == 0) {
              return EMPTY_BUFFER;
          }
  
          byte[] mergedArray = PlatformDependent.allocateUninitializedArray(length);
          for (int i = 0, j = 0; i < arrays.length; i ++) {
              byte[] a = arrays[i];
              System.arraycopy(a, 0, mergedArray, j, a.length);
              j += a.length;
          }
  
          return wrappedBuffer(mergedArray);
      }
docs: Creates a new big-endian buffer whose content is a merged copy of
  the specified {@code arrays}.  The new buffer's {@code readerIndex}
  and {@code writerIndex} are {@code 0} and the sum of all arrays'
  {@code length} respectively.