< prev index next >

src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetConversion.java

Print this page




  37 import java.nio.charset.UnsupportedCharsetException;
  38 import java.nio.charset.UnmappableCharacterException;
  39 import com.sun.corba.se.impl.logging.ORBUtilSystemException;
  40 import com.sun.corba.se.impl.logging.OMGSystemException;
  41 import com.sun.corba.se.spi.logging.CORBALogDomains;
  42 
  43 /**
  44  * Collection of classes, interfaces, and factory methods for
  45  * CORBA code set conversion.
  46  *
  47  * This is mainly used to shield other code from the sun.io
  48  * converters which might change, as well as provide some basic
  49  * translation from conversion to CORBA error exceptions.  Some
  50  * extra work is required here to facilitate the way CORBA
  51  * says it uses UTF-16 as of the 00-11-03 spec.
  52  *
  53  * REVISIT - Since the nio.Charset and nio.Charset.Encoder/Decoder
  54  *           use NIO ByteBuffer and NIO CharBuffer, the interaction
  55  *           and interface between this class and the CDR streams
  56  *           should be looked at more closely for optimizations to
  57  *           avoid unnecessary copying of data between char[] &
  58  *           CharBuffer and byte[] & ByteBuffer, especially
  59  *           DirectByteBuffers.
  60  *
  61  */
  62 public class CodeSetConversion
  63 {
  64     /**
  65      * Abstraction for char to byte conversion.
  66      *
  67      * Must be used in the proper sequence:
  68      *
  69      * 1)  convert
  70      * 2)  Optional getNumBytes and/or getAlignment (if necessary)
  71      * 3)  getBytes (see warning)
  72      */
  73     public abstract static class CTBConverter
  74     {
  75         // Perform the conversion of the provided char or String,
  76         // allowing the caller to query for more information
  77         // before writing.
  78         public abstract void convert(char chToConvert);




  37 import java.nio.charset.UnsupportedCharsetException;
  38 import java.nio.charset.UnmappableCharacterException;
  39 import com.sun.corba.se.impl.logging.ORBUtilSystemException;
  40 import com.sun.corba.se.impl.logging.OMGSystemException;
  41 import com.sun.corba.se.spi.logging.CORBALogDomains;
  42 
  43 /**
  44  * Collection of classes, interfaces, and factory methods for
  45  * CORBA code set conversion.
  46  *
  47  * This is mainly used to shield other code from the sun.io
  48  * converters which might change, as well as provide some basic
  49  * translation from conversion to CORBA error exceptions.  Some
  50  * extra work is required here to facilitate the way CORBA
  51  * says it uses UTF-16 as of the 00-11-03 spec.
  52  *
  53  * REVISIT - Since the nio.Charset and nio.Charset.Encoder/Decoder
  54  *           use NIO ByteBuffer and NIO CharBuffer, the interaction
  55  *           and interface between this class and the CDR streams
  56  *           should be looked at more closely for optimizations to
  57  *           avoid unnecessary copying of data between {@literal char[] &
  58  *           CharBuffer and byte[] & ByteBuffer}, especially
  59  *           DirectByteBuffers.
  60  *
  61  */
  62 public class CodeSetConversion
  63 {
  64     /**
  65      * Abstraction for char to byte conversion.
  66      *
  67      * Must be used in the proper sequence:
  68      *
  69      * 1)  convert
  70      * 2)  Optional getNumBytes and/or getAlignment (if necessary)
  71      * 3)  getBytes (see warning)
  72      */
  73     public abstract static class CTBConverter
  74     {
  75         // Perform the conversion of the provided char or String,
  76         // allowing the caller to query for more information
  77         // before writing.
  78         public abstract void convert(char chToConvert);


< prev index next >