mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 预约启动
This commit is contained in:
@@ -2,6 +2,7 @@ package com.jsowell.common.util;
|
||||
|
||||
import com.google.common.primitives.Bytes;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import org.springframework.mail.MailMessage;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -424,6 +425,13 @@ 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);
|
||||
}
|
||||
|
||||
public static byte[] str2AscLittle(String str) {
|
||||
return revert(str2Asc(str));
|
||||
}
|
||||
@@ -626,21 +634,6 @@ public class BytesUtil {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
byte[] originalBytes = {1, 2, 3};
|
||||
int desiredLength = 5;
|
||||
byte[] result = ensureLengthPrependZero(originalBytes, desiredLength);
|
||||
|
||||
System.out.println("Original array: ");
|
||||
for (byte b : originalBytes) {
|
||||
System.out.print(b + " ");
|
||||
}
|
||||
System.out.println("\nResulting array with padding at the beginning: ");
|
||||
for (byte b : result) {
|
||||
System.out.print(b + " ");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 确保byte数组长度至少为指定长度,不足则在前面补充0。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user