mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 预约启动
This commit is contained in:
@@ -8,6 +8,7 @@ import javax.xml.bind.DatatypeConverter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -403,6 +404,11 @@ public class BytesUtil {
|
||||
return rightPadBytes(target, len, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* ASCII转字符串 小端模式
|
||||
* @param ascs
|
||||
* @return
|
||||
*/
|
||||
public static String ascii2StrLittle(byte[] ascs) {
|
||||
byte[] data = revert(ascs);
|
||||
String asciiStr = null;
|
||||
@@ -414,6 +420,11 @@ public class BytesUtil {
|
||||
return asciiStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* ASCII转字符串
|
||||
* @param ascs
|
||||
* @return
|
||||
*/
|
||||
public static String ascii2Str(byte[] ascs) {
|
||||
byte[] data = ascs;
|
||||
String asciiStr = null;
|
||||
@@ -425,17 +436,20 @@ public class BytesUtil {
|
||||
return asciiStr;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String vin1 = "SAITER00000000001";
|
||||
byte[] bytes = str2Asc(vin1);
|
||||
String s = ascii2Str(bytes);
|
||||
System.out.println(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转ASCII 小端模式
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static byte[] str2AscLittle(String str) {
|
||||
return revert(str2Asc(str));
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转ASCII
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static byte[] str2Asc(String str) {
|
||||
byte[] bytes = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user