public class CharsetDetector extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static Charset |
detect(File file)
探测文件内容字符集
|
static Charset |
detect(InputStream inputStream)
探测流内容字符集内容
|
static Charset |
detect(InputStream inputStream,
int langFlag)
探测流内容字符集内容
|
static Charset |
detect(String path)
Detecting a file content character set based on a file path
依据文件路径探测文件内容字符集
|
static Charset |
detectStr(String content)
Detector string content character set
探测字符串内容字符集
|
public static Charset detectStr(String content) throws IOException
content - 字符串内容IOExceptionpublic static Charset detect(String path) throws IOException
path - the path of file
文件路径IOExceptionpublic static Charset detect(File file) throws IOException
IOExceptionpublic static Charset detect(InputStream inputStream) throws IOException
IOExceptionpublic static Charset detect(InputStream inputStream, int langFlag) throws IOException
IOExceptionCopyright © 2023. All rights reserved.