Package org.apache.any23.encoding

Interface EncodingDetector

  • All Known Implementing Classes:
    TikaEncodingDetector

    public interface EncodingDetector
    Defines a detector for charset encoding.
    Author:
    Michele Mostarda ( michele.mostarda@gmail.com )
    • Method Detail

      • guessEncoding

        default String guessEncoding​(InputStream input,
         String contentType)
         throws IOException 
        Guesses the data encoding.
        Parameters:
        input - the input stream containing the data.
        contentType - the declared content type of the data.
        Returns:
        a string compliant to IANA Charset Specification.
        Throws:
        IOException - if there is an error whilst guessing the encoding.