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

ByteArrayOutputStream should have a toString(Charset) method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • tbd
    • 8u45
    • core-libs
    • generic
    • generic

      A DESCRIPTION OF THE REQUEST :
      UnsupportedEncodingException has a

       toString(String charsetName)

      method but no

       toString(Charset)

      method.

      JUSTIFICATION :
      Every class that provides a conversion from bytes to string should have a method that takes a Charset object as a parameter.

      Otherwise conversion between Charset and charset name has unnecessarily to be done, and UnsupportedEncodingException have to be handled where they could not occur.

      ACTUAL -
      The implementation is missing.

      CUSTOMER SUBMITTED WORKAROUND :
      See above.

            joehw Joe Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: