org.ccil.cowan.tagsoup

Interface AutoDetector

public interface AutoDetector

Classes which accept an InputStream and provide a Reader which figures out the encoding of the InputStream and reads characters from it should conform to this interface.

See Also: java.io.InputStream java.io.Reader

Method Summary
ReaderautoDetectingReader(InputStream i)
Given an InputStream, return a suitable Reader that understands the presumed character encoding of that InputStream.

Method Detail

autoDetectingReader

public Reader autoDetectingReader(InputStream i)
Given an InputStream, return a suitable Reader that understands the presumed character encoding of that InputStream. If bytes are consumed from the InputStream in the process, they must be pushed back onto the InputStream so that they can be reinterpreted as characters.

Parameters: i The InputStream

Returns: A Reader that reads from the InputStream

Licence: Academic Free License 3.0 and/or GPL 2.0