Package com.sun.corba.ee.impl.encoding
Class CodeSetConversion.UTF16BTCConverter
java.lang.Object
com.sun.corba.ee.impl.encoding.CodeSetConversion.BTCConverter
com.sun.corba.ee.impl.encoding.CodeSetConversion.JavaBTCConverter
com.sun.corba.ee.impl.encoding.CodeSetConversion.UTF16BTCConverter
- Enclosing class:
CodeSetConversion
Special converter for UTF16 since it's required to optionally
support a byte order marker while the internal Java converters
either require it or require that it isn't there.
The solution is to check for the byte order marker, and if we
need to do something differently, switch internal converters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private ByteOrder
private static final char
private static final char
Fields inherited from class com.sun.corba.ee.impl.encoding.CodeSetConversion.JavaBTCConverter
decoder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchar[]
getChars
(byte[] bytes, int offset, int numBytes) char[]
getChars
(ByteBuffer byteBuffer, int offset, int numBytes) private boolean
hasUTF16ByteOrderMarker
(byte[] array, int offset, int length) Utility method for determining if a UTF-16 byte order marker is present.private void
switchToConverter
(OSFCodeSetRegistry.Entry newCodeSet) The current solution for dealing with UTF-16 in CORBA is that if our sun.io converter requires byte order markers, and then we see a CORBA wstring/wchar without them, we switch to the sun.io converter that doesn't require them.Methods inherited from class com.sun.corba.ee.impl.encoding.CodeSetConversion.JavaBTCConverter
getConverter, getNumChars
-
Field Details
-
defaultByteOrder
-
converterUsesBOM
private boolean converterUsesBOM -
UTF16_BE_MARKER
private static final char UTF16_BE_MARKER- See Also:
-
UTF16_LE_MARKER
private static final char UTF16_LE_MARKER- See Also:
-
-
Constructor Details
-
UTF16BTCConverter
UTF16BTCConverter(ByteOrder defaultByteOrder)
-
-
Method Details
-
getChars
- Overrides:
getChars
in classCodeSetConversion.JavaBTCConverter
-
getChars
public char[] getChars(byte[] bytes, int offset, int numBytes) - Overrides:
getChars
in classCodeSetConversion.JavaBTCConverter
-
hasUTF16ByteOrderMarker
private boolean hasUTF16ByteOrderMarker(byte[] array, int offset, int length) Utility method for determining if a UTF-16 byte order marker is present. -
switchToConverter
The current solution for dealing with UTF-16 in CORBA is that if our sun.io converter requires byte order markers, and then we see a CORBA wstring/wchar without them, we switch to the sun.io converter that doesn't require them.
-