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

Availability of sun.io.ByteToCharConverter: move sun.io converters into java.io

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2
    • core-libs
    • generic
    • generic



      Name: dbT83986 Date: 11/06/99


      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)
      Character to byte encoding conversions are currently made
      available only in OutputStreamWriter, InputSreamReader and
      String classes. I.e. there is no way for an application to
      invoke directly the sun.io converters.
      This makes close to impossible for an application to read
      files which have sequences of bytes mixed to sequences of
      (encoded) characters. Note that currently an application can
      produce files like that by using PrintStreams, but can not
      read them.
      Little avails String constructors that wrap sun.io converters
      like e.g. String(byte[] bytes, String enc) because they convert
      a given amount of bytes, while what is needed to read character
      files in the opposite: convert as many bytes as needed to deliver
      the requested number of character, which is exactly what the
      sun.io converters do.
      The request is then to move sun.io converters into java.io, thus
      allowing applications to use them directly.
      Note that by using java io an application has a view of files as
      pure sequences of bytes, which can be interpreted as bytes,
      characters, integers, etc. by the application without any restrictions
      imposed by the underlying runtime support.
      This is a very good and simple model that gives great flexibility
      to applications. However, without a possibility for applications
      to invoke directly character converters, this flexibility is not
      100% available, which would instead be the case if those classes
      were moved from sun.io to java.io.
      (Review ID: 97521)
      ======================================================================

            Unassigned Unassigned
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: