public class FileUtilitiesByThirdParty
extends java.lang.Object
This class will use some third-party jars to provide some functionalities.
For example, method detectFileEncoding(String)
will depend on
juniversalchardet
This class is created for making class FileUtilities
independent
of these third-party jars. In FileUtilities
, we use java-reflection
to call methods in this class.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BTYES_TO_READ |
Constructor and Description |
---|
FileUtilitiesByThirdParty() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
detectFileEncoding(java.lang.String filename)
Opens a FileInputStream and detects its encoding.
|
static java.lang.String |
detectStringEncoding(java.lang.String str)
Read String as input to find encoding.
|
public static final int MAX_BTYES_TO_READ
public static java.lang.String detectFileEncoding(java.lang.String filename)
filename
- String, case-insensitive absolute filename path.FileUtilities.detectFileEncoding(String)
public static java.lang.String detectStringEncoding(java.lang.String str)
Copyright © SAS Institute. All Rights Reserved.