|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ICodepageDetector
| Method Summary | |
|---|---|
Charset |
detectCodepage(InputStream in,
int length)
This method allows to detect the charset encoding from every source (even a String, which an URL does not decorate!). |
Charset |
detectCodepage(URL url)
Low-level method that detects the codepage (charset) of the document specified by the given URL. |
Reader |
open(URL url)
High level method to open documents in the correct codepage. |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Method Detail |
|---|
Reader open(URL url)
throws IOException
High level method to open documents in the correct codepage.
Implementations of this method should delegate to the low-level method
detectCodepage(URL).
Detect the codepage of the document pointed to by the URL argument. If the codepage could not be detected, null has to be returned. If the given URL does not point to a document or it is not possible to open the document specified by the given URL, an IOException is thrown.
IOException - thrown to indicate that it is was not possible to open the
document specified by the given URL.
Charset detectCodepage(URL url)
throws IOException
Low-level method that detects the codepage (charset) of the document specified by the given URL.
Charsetthat represents the
document's codepage.
IOException - thrown to indicate that it is was not possible to open the
document specified by the given URL.
Charset detectCodepage(InputStream in,
int length)
throws IOException
This method allows to detect the charset encoding from every source (even a String, which an URL does not decorate!).
Note that you cannot reuse the given InputStream unless it supports marking (InputStream.markSupported() ==
true), you mark the initial position with a sufficient readlimit and invoke
reset afterwards (without getting any exception).
in - An InputStream for the document, that supports mark and a
readlimit of argument length.length - The amount of bytes to take into account. This number should not
be longer than the amount of bytes retrievable from the
InputStream but should be as long as possible to give the fallback
detection (chardet) more hints to guess.
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||