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

Avoid ByteArrayOutputStream.toByteArray when converting stream to String

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 16, 17, 18
    • Fix Version/s: 18
    • Component/s: client-libs
    • Labels:
      None
    • Resolved In Build:
      b15

      Description

      Using ByteArrayOutputStream.toString to convert its content to a String is cleaner than new String(out.toByteArray()). Also it's a bit faster because of one less array copy.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aturbanov Andrey Turbanov
              Reporter:
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: