Clean code
This commit is contained in:
parent
90ff5c9376
commit
34d7c2bb97
|
|
@ -49,7 +49,7 @@ public class Utils {
|
||||||
return hasCamera && hasPhone && hasBT;
|
return hasCamera && hasPhone && hasBT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isGBK(byte[] bytes) {
|
public static boolean isGbk(byte[] bytes) {
|
||||||
Charset charset = Charset.forName("GBK");
|
Charset charset = Charset.forName("GBK");
|
||||||
String str = new String(bytes, charset);
|
String str = new String(bytes, charset);
|
||||||
byte[] newBytes = str.getBytes(charset);
|
byte[] newBytes = str.getBytes(charset);
|
||||||
|
|
@ -57,7 +57,7 @@ public class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] toUtf8(byte[] bytes) throws Exception {
|
public static byte[] toUtf8(byte[] bytes) throws Exception {
|
||||||
return isGBK(bytes) ? new String(bytes, Charset.forName("GBK")).getBytes("UTF-8") : bytes;
|
return isGbk(bytes) ? new String(bytes, Charset.forName("GBK")).getBytes("UTF-8") : bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSub(String ext) {
|
public static boolean isSub(String ext) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue