code: public static ByteBuf copiedBuffer(byte[] array, int offset, int length) {
          if (length == 0) {
              return EMPTY_BUFFER;
          }
          byte[] copy = PlatformDependent.allocateUninitializedArray(length);
          System.arraycopy(array, offset, copy, 0, length);
          return wrappedBuffer(copy);
      }
docs: Creates a new big-endian buffer whose content is a copy of the
  specified {@code array}'s sub-region.  The new buffer's
  {@code readerIndex} and {@code writerIndex} are {@code 0} and
  the specified {@code length} respectively.