Need StringBuffer.append(StringBuffer sb)

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.3.0
    • Component/s: core-libs
    • generic
    • generic



      Name: krT82822 Date: 09/24/99


      orig synopsis: "Lack of an add method for StringBuffer class with StringBuffer as a parameter"

      StringBuffer doesn't have an "add" method with StringBuffer as
      a parameter. This method could help to "concatenate" one
      StringBuffer to another without converting to String or
      playing with "char" arrays.

      The following is the proposed implementation for this method:

          public synchronized StringBuffer append(StringBuffer strbuf)
          {
            int len = strbuf.length();
            int newcount = count + len;
            if (newcount > value.length)
              expandCapacity(newcount);
            System.arraycopy(strbuf.getValue(), 0, value, count, len);
            count = newcount;
            return this;
          }
      (Review ID: 95673)
      ======================================================================

            Assignee:
            Unassigned
            Reporter:
            Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: