Class UnicodeHelper


  • public class UnicodeHelper
    extends java.lang.Object
    Provides default and / or bridged (to Eclipse, etc.) Unicode helper methods. May disappear or be moved in a future refactoring.
    • Constructor Summary

      Constructors 
      Constructor Description
      UnicodeHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean inferCharset​(byte[] bytes, int bytesRead, java.nio.charset.Charset clientCharset)
      Try to determine whether a byte buffer's character encoding is that of the passed-in charset.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnicodeHelper

        public UnicodeHelper()
    • Method Detail

      • inferCharset

        public static boolean inferCharset​(byte[] bytes,
                                           int bytesRead,
                                           java.nio.charset.Charset clientCharset)
        Try to determine whether a byte buffer's character encoding is that of the passed-in charset. Uses inefficient heuristics that will be revisited when we're more familiar with likely usage patterns.

        Note this has been heavily changed since inception and will almost certainly disappear in the 10.x timeframe -- HR.

        Parameters:
        bytes - bytes
        bytesRead - bytesRead
        clientCharset - clientCharset
        Returns:
        ok