JDK-4288746 : Availability of sun.io.ByteToCharConverter: move sun.io converters into java.io
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-11-07
  • Updated: 1999-11-10
  • Resolved: 1999-11-10
Related Reports
Duplicate :  
Description

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) 
======================================================================

Comments
EVALUATION Part of the new I/O framework is a public converter API. michael.mccloskey@eng 1999-11-10
10-11-1999