Class GuessEncodingCharsetFinder

    • Constructor Detail

      • GuessEncodingCharsetFinder

        public GuessEncodingCharsetFinder()
    • Method Detail

      • detectCharsetImpl

        protected Charset detectCharsetImpl​(byte[] buffer)
                                     throws Exception
        Description copied from class: AbstractCharactersetFinder
        Worker method for implementations to override. All exceptions will be reported and absorbed and null returned.

        The interface contract is that the data buffer must not be altered in any way.

        Specified by:
        detectCharsetImpl in class AbstractCharactersetFinder
        Parameters:
        buffer - the buffer of data no bigger than the requested best buffer size. This can, very efficiently, be turned into an InputStream using a ByteArrayInputStream.
        Returns:
        Returns the charset or null if an accurate conclusion is not possible
        Throws:
        Exception - Any exception, checked or not