Class 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 Detail

      • defaultByteOrder

        private java.nio.ByteOrder defaultByteOrder
      • converterUsesBOM

        private boolean converterUsesBOM
    • Constructor Detail

      • UTF16BTCConverter

        UTF16BTCConverter​(java.nio.ByteOrder defaultByteOrder)
    • Method Detail

      • 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.