|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.weborganic.ox.util.CharsetDetector
public final class CharsetDetector
This class can be used to detect the Charset for a file.
Nested Class Summary | |
---|---|
static class |
CharsetDetector.ByteOrderMark
An enumeration of byte order marks supported by this class. |
Method Summary | |
---|---|
static CharBuffer |
decode(File f)
Returns the encoding of the specified file by examining its content. |
static Charset |
getFromBOM(File f)
Returns the encoding of the specified file based on the byte-order mark to see if it matches a charset defined in this class. |
static Charset |
getFromContent(File f)
Returns the encoding of the specified file by examining its content. |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Charset getFromBOM(File f) throws IOException
null
if there is no byte order mark.
f
- The file to check the encoding for.
IOException
- If thrown while attempting to read the file.public static Charset getFromContent(File f) throws IOException
f
- The file to check the encoding for.
IOException
- If thrown while attempting to read the file.public static CharBuffer decode(File f) throws IOException
f
- The file to check the encoding for.
IOException
- If thrown while attempting to read the file.public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |