Add a private constructor to hide the implicit public one.

master
Joe Zhou 2024-06-04 01:02:45 +08:00
parent 5c43e36118
commit 49a5efff46
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ public abstract class CharsetUtils {
private static Logger logger = LoggerFactory.getLogger(CharsetUtils.class);
private CharsetUtils() {
throw new AssertionError("No us.codecraft.webmagic.utils.CharsetUtils instances for you!");
}
public static String detectCharset(String contentType, byte[] contentBytes) throws IOException {
String charset;
// charset