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
private class CodeSetConversion.UTF16BTCConverter extends CodeSetConversion.JavaBTCConverter
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
Fields Modifier and Type Field Description private boolean
converterUsesBOM
private java.nio.ByteOrder
defaultByteOrder
private static char
UTF16_BE_MARKER
private static char
UTF16_LE_MARKER
-
Fields inherited from class com.sun.corba.ee.impl.encoding.CodeSetConversion.JavaBTCConverter
decoder
-
-
Constructor Summary
Constructors Constructor Description UTF16BTCConverter(java.nio.ByteOrder defaultByteOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char[]
getChars(byte[] bytes, int offset, int numBytes)
char[]
getChars(java.nio.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 Detail
-
defaultByteOrder
private java.nio.ByteOrder defaultByteOrder
-
converterUsesBOM
private boolean converterUsesBOM
-
UTF16_BE_MARKER
private static final char UTF16_BE_MARKER
- See Also:
- Constant Field Values
-
UTF16_LE_MARKER
private static final char UTF16_LE_MARKER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChars
public char[] getChars(java.nio.ByteBuffer byteBuffer, int offset, int numBytes)
- 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
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.
-
-