java.lang.Object
org.glavo.chardet.ReaderFactory
Create a reader from a file with correct encoding
-
方法概要
修饰符和类型方法说明static BufferedReadercreateBufferedReader(byte[] data) Create a reader from a byte array with correct encoding.static BufferedReadercreateBufferedReader(byte[] data, Charset defaultCharset) Create a reader from a byte array with correct encodingstatic BufferedReadercreateBufferedReader(Path file) Create a reader from a file with correct encoding.static BufferedReadercreateBufferedReader(Path file, Charset defaultCharset) Create a reader from a file with correct encoding
-
方法详细资料
-
createBufferedReader
public static BufferedReader createBufferedReader(Path file, Charset defaultCharset) throws IOException Create a reader from a file with correct encoding- 参数:
file- The file to read fromdefaultCharset- defaultCharset to use if it can't be determined- 返回:
- BufferedReader for the file with the correct encoding
- 抛出:
IOException- if some I/O error occurs
-
createBufferedReader
Create a reader from a file with correct encoding. If charset cannot be determined, it uses the UTF-8.- 参数:
file- The file to read from- 返回:
- BufferedReader for the file with the correct encoding
- 抛出:
IOException- if some I/O error occurs
-
createBufferedReader
public static BufferedReader createBufferedReader(byte[] data, Charset defaultCharset) throws IOException Create a reader from a byte array with correct encoding- 参数:
data- The byte[] to read fromdefaultCharset- defaultCharset to use if can't be determined- 返回:
- BufferedReader for the file with the correct encoding
- 抛出:
IOException- if some I/O error occurs
-
createBufferedReader
Create a reader from a byte array with correct encoding. If charset cannot be determined, it uses the UTF-8.- 参数:
data- The byte[] to read from- 返回:
- BufferedReader for the file with the correct encoding
- 抛出:
IOException- if some I/O error occurs
-