Package org.mozilla.universalchardet
Class ReaderFactory
- java.lang.Object
-
- org.mozilla.universalchardet.ReaderFactory
-
public final class ReaderFactory extends java.lang.ObjectCreate a reader from a file with correct encoding
-
-
Constructor Summary
Constructors Modifier Constructor Description privateReaderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.io.BufferedReadercreateBufferedReader(java.io.File file)Create a reader from a file with correct encoding.static java.io.BufferedReadercreateBufferedReader(java.io.File file, java.nio.charset.Charset defaultCharset)Create a reader from a file with correct encodingstatic java.io.ReadercreateReaderFromFile(java.io.File file)Deprecated.static java.io.ReadercreateReaderFromFile(java.io.File file, java.nio.charset.Charset defaultCharset)Deprecated.
-
-
-
Method Detail
-
createBufferedReader
public static java.io.BufferedReader createBufferedReader(java.io.File file, java.nio.charset.Charset defaultCharset) throws java.io.IOExceptionCreate a reader from a file with correct encoding- Parameters:
file- The file to read fromdefaultCharset- defaultCharset to use if can't be determined- Returns:
- BufferedReader for the file with the correct encoding
- Throws:
java.io.IOException- if some I/O error ocurrs
-
createBufferedReader
public static java.io.BufferedReader createBufferedReader(java.io.File file) throws java.io.IOExceptionCreate a reader from a file with correct encoding. If charset cannot be determined, it uses the system default charset.- Parameters:
file- The file to read from- Returns:
- BufferedReader for the file with the correct encoding
- Throws:
java.io.IOException- if some I/O error ocurrs
-
createReaderFromFile
@Deprecated public static java.io.Reader createReaderFromFile(java.io.File file, java.nio.charset.Charset defaultCharset) throws java.io.IOExceptionDeprecated.Create a reader from a file with the correct encoding- Parameters:
file- The file to read fromdefaultCharset- defaultCharset to use if can't be determined- Returns:
- Reader for the file with the correct encoding
- Throws:
java.io.IOException- if some I/O error ocurrs
-
createReaderFromFile
@Deprecated public static java.io.Reader createReaderFromFile(java.io.File file) throws java.io.IOExceptionDeprecated.Create a reader from a file with the correct encoding. If charset cannot be determined, it uses the system default charset.- Parameters:
file- The file to read from- Returns:
- Reader for the file with the correct encoding
- Throws:
java.io.IOException- if some I/O error ocurrs
-
-