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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: None
    • Component/s: 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.

            Assignee:
            Claes Redestad
            Reporter:
            Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: