Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4275366

Need StringBuffer.append(StringBuffer sb)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: