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

Reduce char[] copying in URLEncoder.encode(String, Charset)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • None
    • core-libs
    • None
    • b06

      Instead of allocating a copy of underlying array via charArrayWriter.toCharArray() and passing it to constructor of String

        String str = new String(charArrayWriter.toCharArray());

      we could call toString() method

        String str = charArrayWriter.toString();

      decoding existing char[] without making a copy.

            redestad Claes Redestad
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: