|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.monitorenter.cpdetector.io.AbstractCodepageDetector
info.monitorenter.cpdetector.io.HTMLCodepageDetector
ParsingDetector.
Future versions may drop this class.
This class has been replaced by ParsingDetector and only exists for backward-compatibility.
The name simply would not match any more, as parsing is not limited to html (1.1 includes xml as well). New code
should stick to the replacement. This class has been modified with version 1.1 and now is delegating all calls to an
instance of the replacement class (5 minutes with eclipse and a common interface), which introduces a small overhead
(minimal, as one invokevirtual is nothing compared to codepage detection by parsing).
Documentation may be found in the class ParsingDetector. It is valid for this class.
ParsingDetector,
Serialized Form| Constructor Summary | |
HTMLCodepageDetector()
Deprecated. |
|
HTMLCodepageDetector(boolean verbose)
Deprecated. |
|
| Method Summary | |
int |
compareTo(Object o)
Deprecated. |
Charset |
detectCodepage(InputStream in,
int length)
Deprecated. This method allows to detect the charset encoding from every source (even a String, which an URL does not decorate!). |
Charset |
detectCodepage(URL url)
Deprecated. Delegates to detectCodepage(java.io.InputStream, int) with a buffered input stream.
|
boolean |
equals(Object obj)
Deprecated. |
int |
hashCode()
Deprecated. |
String |
toString()
Deprecated. |
| Methods inherited from class info.monitorenter.cpdetector.io.AbstractCodepageDetector |
open |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public HTMLCodepageDetector()
public HTMLCodepageDetector(boolean verbose)
| Method Detail |
public int compareTo(Object o)
compareTo in interface ComparablecompareTo in class AbstractCodepageDetectorComparable.compareTo(java.lang.Object)
public Charset detectCodepage(InputStream in,
int length)
throws IOException
ICodepageDetectorThis 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
public Charset detectCodepage(URL url)
throws IOException
AbstractCodepageDetectorICodepageDetector.detectCodepage(java.io.InputStream, int) with a buffered input stream.
detectCodepage in interface ICodepageDetectordetectCodepage in class AbstractCodepageDetectorIOExceptionICodepageDetector.detectCodepage(URL)public boolean equals(Object obj)
public int hashCode()
public String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||