code: public static ByteBuf copiedBuffer(ByteBuf... buffers) {
          switch (buffers.length) {
          case 0:
              return EMPTY_BUFFER;
          case 1:
              return copiedBuffer(buffers[0]);
          }
  
          // Merge the specified buffers into one buffer.
          ByteOrder order = null;
          int length = 0;
          for (ByteBuf b: buffers) {
              int bLen = b.readableBytes();
              if (bLen <= 0) {
                  continue;
              }
              if (Integer.MAX_VALUE - length < bLen) {
                  throw new IllegalArgumentException(
                          "The total length of the specified buffers is too big.");
              }
              length += bLen;
              if (order != null) {
                  if (!order.equals(b.order())) {
                      throw new IllegalArgumentException("inconsistent byte order");
                  }
              } else {
                  order = b.order();
              }
          }
  
          if (length == 0) {
              return EMPTY_BUFFER;
          }
  
          byte[] mergedArray = PlatformDependent.allocateUninitializedArray(length);
          for (int i = 0, j = 0; i < buffers.length; i ++) {
              ByteBuf b = buffers[i];
              int bLen = b.readableBytes();
              b.getBytes(b.readerIndex(), mergedArray, j, bLen);
              j += bLen;
          }
  
          return wrappedBuffer(mergedArray).order(order);
      }
docs: Creates a new buffer whose content is a merged copy of the specified
  {@code buffers}' readable bytes.  The new buffer's {@code readerIndex}
  and {@code writerIndex} are {@code 0} and the sum of all buffers'
  {@code readableBytes} respectively.
  
  @throws IllegalArgumentException
  if the specified buffers' endianness are different from each
  other