code: public void copy(int start, int limit, int dest) {
          if (start == limit && start >= 0 && start <= buf.length()) {
              return;
          }
          char[] text = new char[limit - start];
          getChars(start, limit, text, 0);
          replace(dest, dest, text, 0, limit - start);
      }
docs: Copy a substring of this object, retaining attribute (out-of-band)
  information.  This method is used to duplicate or reorder substrings.
  The destination index must not overlap the source range.
  
  @param start the beginning index, inclusive; <code>0 &lt;= start &lt;=
  limit</code>.
  @param limit the ending index, exclusive; <code>start &lt;= limit &lt;=
  length()</code>.
  @param dest the destination index.  The characters from
  <code>start..limit-1</code> will be copied to <code>dest</code>.
  Implementations of this method may assume that <code>dest &lt;= start ||
  dest &gt;= limit</code>.