Package org.apache.any23.encoding

## Class TikaEncodingDetector

- java.lang.Object
- - org.apache.any23.encoding.TikaEncodingDetector

- All Implemented Interfaces:
    `EncodingDetector`

      public class TikaEncodingDetector
      extends Object
      implements EncodingDetector

  An implementation of `EncodingDetector` based on Apache Tika.
  Version:
    $Id$
  Author:
    Michele Mostarda ( michele.mostarda@gmail.com ), Davide Palmisano ( dpalmisano@gmail.com ), Hans Brende (hansbrende@apache.org)

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TikaEncodingDetector()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `guessEncoding​(InputStream input)` | Guesses the data encoding.
    `String` | `guessEncoding​(InputStream is, String contentType)` | Guesses the data encoding.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TikaEncodingDetector

          public TikaEncodingDetector()

  - ### Method Detail

    - #### guessEncoding

          public String guessEncoding​(InputStream input)
                               throws IOException

      Description copied from interface: `EncodingDetector`
      Guesses the data encoding.
      Specified by:
        `guessEncoding` in interface `EncodingDetector`
      Parameters:
        `input` - the input stream containing the data.
      Returns:
        a string compliant to IANA Charset Specification.
      Throws:
        `IOException` - if there is an error whilst guessing the encoding.

    - #### guessEncoding

          public String guessEncoding​(InputStream is,
                                      String contentType)
                               throws IOException

      Description copied from interface: `EncodingDetector`
      Guesses the data encoding.
      Specified by:
        `guessEncoding` in interface `EncodingDetector`
      Parameters:
        `is` - 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.