Class EncodingDetector


  • public final class EncodingDetector
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String detectEncoding​(java.io.File inFile)
      Detect the encoding of the supplied file.
      static java.lang.String detectEncoding​(java.io.InputStream stream)
      Detect the encoding of the supplied file.
      static java.lang.String detectEncodingDefault​(java.io.File inFile, java.lang.String defaultEncoding)
      Detect the encoding of the supplied file.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • detectEncoding

        public static java.lang.String detectEncoding​(java.io.File inFile)
                                               throws java.io.IOException
        Detect the encoding of the supplied file. Convenience method for detectEncoding(java.io.InputStream).
        Throws:
        java.io.IOException
      • detectEncoding

        public static java.lang.String detectEncoding​(java.io.InputStream stream)
                                               throws java.io.IOException
        Detect the encoding of the supplied file. The caller is responsible for closing the stream.
        Throws:
        java.io.IOException
        See Also:
        Original, Fork
      • detectEncodingDefault

        public static java.lang.String detectEncodingDefault​(java.io.File inFile,
                                                             java.lang.String defaultEncoding)
        Detect the encoding of the supplied file. If detection fails, return the supplied default encoding.