Package com.sun.corba.se.impl.encoding
Class CodeSetConversion
java.lang.Object
com.sun.corba.se.impl.encoding.CodeSetConversion
Collection of classes, interfaces, and factory methods for
CORBA code set conversion.
This is mainly used to shield other code from the sun.io
converters which might change, as well as provide some basic
translation from conversion to CORBA error exceptions. Some
extra work is required here to facilitate the way CORBA
says it uses UTF-16 as of the 00-11-03 spec.
REVISIT - Since the nio.Charset and nio.Charset.Encoder/Decoder
use NIO ByteBuffer and NIO CharBuffer, the interaction
and interface between this class and the CDR streams
should be looked at more closely for optimizations to
avoid unnecessary copying of data between char[] &
CharBuffer and byte[] & ByteBuffer, especially
DirectByteBuffers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstraction for byte to char conversion.static classAbstraction for char to byte conversion. -
Method Summary
Modifier and TypeMethodDescriptiongetBTCConverter(OSFCodeSetRegistry.Entry codeset) BTCConverter factory for single byte or variable width encodings.getBTCConverter(OSFCodeSetRegistry.Entry codeset, boolean defaultToLittleEndian) BTCConverter factory for fixed width multibyte encodings.getCTBConverter(OSFCodeSetRegistry.Entry codeset) CTB converter factory for single byte or variable length encodings.getCTBConverter(OSFCodeSetRegistry.Entry codeset, boolean littleEndian, boolean useByteOrderMarkers) CTB converter factory for multibyte (mainly fixed) encodings.static final CodeSetConversionimpl()CodeSetConversion is a singleton, and this is the access point.negotiate(CodeSetComponentInfo client, CodeSetComponentInfo server) Perform the code set negotiation algorithm and come up with the two encodings to use.
-
Method Details
-
getCTBConverter
CTB converter factory for single byte or variable length encodings. -
getCTBConverter
public CodeSetConversion.CTBConverter getCTBConverter(OSFCodeSetRegistry.Entry codeset, boolean littleEndian, boolean useByteOrderMarkers) CTB converter factory for multibyte (mainly fixed) encodings. Because of the awkwardness with byte order markers and the possibility of using UCS-2, you must specify both the endianness of the stream as well as whether or not to use byte order markers if applicable. UCS-2 has no byte order markers. UTF-16 has optional markers. If you select useByteOrderMarkers, there is no guarantee that the encoding will use the endianness specified. -
getBTCConverter
BTCConverter factory for single byte or variable width encodings. -
getBTCConverter
public CodeSetConversion.BTCConverter getBTCConverter(OSFCodeSetRegistry.Entry codeset, boolean defaultToLittleEndian) BTCConverter factory for fixed width multibyte encodings. -
negotiate
public CodeSetComponentInfo.CodeSetContext negotiate(CodeSetComponentInfo client, CodeSetComponentInfo server) Perform the code set negotiation algorithm and come up with the two encodings to use. -
impl
CodeSetConversion is a singleton, and this is the access point.
-