public class SoftBasic extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static SystemVersion |
FrameworkVersion
设置或获取系统框架的版本号
Set or get the version number of the system framework |
| 构造器和说明 |
|---|
SoftBasic() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T[] |
AddArrayData(Class<T> tClass,
T[] array,
T[] data,
int max)
一个通用的数组新增个数方法,会自动判断越界情况,越界的情况下,会自动的截断或是填充
A common array of new methods, will automatically determine the cross-border situation, in the case of cross-border, will be automatically truncated or filled |
static byte[] |
ArrayExpandToLength(byte[] data,
int length)
将byte数组的长度扩充到指定长度
Extend an byte array to a specified length, or shorten to a specified length or fill
|
static <T> T[] |
ArrayExpandToLength(Class<T> tClass,
T[] data,
int length)
将一个数组进行扩充到指定长度,或是缩短到指定长度
Extend an array to a specified length, or shorten to a specified length or fill |
static byte[] |
ArrayExpandToLengthEven(byte[] data)
将byte数组的长度扩充到偶数长度
Extend an byte array to even lengths
|
static <T> T[] |
ArrayExpandToLengthEven(Class<T> tClass,
T[] data)
将一个数组进行扩充到偶数长度
Extend an array to even lengths |
static <T> String |
ArrayFormat(T array)
将数组格式化为显示的字符串的信息,支持所有的类型对象
Formats the array into the displayed string information, supporting all types of objects |
static <T> String |
ArrayFormat(T[] array)
将数组格式化为显示的字符串的信息,支持所有的类型对象
Formats the array into the displayed string information, supporting all types of objects |
static <T> String |
ArrayFormat(T[] array,
String format)
将数组格式化为显示的字符串的信息,支持所有的类型对象
Formats the array into the displayed string information, supporting all types of objects |
static <T> String |
ArrayFormat(T array,
String format)
将数组格式化为显示的字符串的信息,支持所有的类型对象
Formats the array into the displayed string information, supporting all types of objects |
static <T> T[] |
ArrayRemoveBegin(Class<T> clazz,
T[] value,
int length)
将一个数组的前后移除指定位数,返回新的一个数组
Removes the preceding specified number of bits in a array, returning a new array |
static <T> T[] |
ArrayRemoveDouble(Class<T> clazz,
T[] value,
int leftLength,
int rightLength)
将一个泛型数组的前后移除指定位数,返回新的一个数组
Removes a array before and after the specified number of bits, returning a new array |
static <T> T[] |
ArrayRemoveLast(Class<T> clazz,
T[] value,
int length)
将一个数组的后面指定位数移除,返回新的一个数组
Removes the specified number of digits after a array, returning a new array |
static <T> T[] |
ArraySelectBegin(Class<T> clazz,
T[] value,
int length)
选择一个数组的前面的几个数据信息
Select the begin few items of data information of a array |
static <T> T[] |
ArraySelectLast(Class<T> clazz,
T[] value,
int length)
选择一个数组的后面的几个数据信息
Select the last few items of data information of a array |
static <T> T[] |
ArraySelectMiddle(Class<T> clazz,
T[] value,
int index,
int length)
获取到数组里面的中间指定长度的数组
Get an array of the specified length in the array |
static ArrayList<byte[]> |
ArraySplitByLength(byte[] array,
int length)
切割字节数组信息
|
static <T> ArrayList<T[]> |
ArraySplitByLength(Class<T> tClass,
T[] array,
int length)
将指定的数据按照指定长度进行分割,例如int[10],指定长度4,就分割成int[4],int[4],int[2],然后拼接list
Divide the specified data according to the specified length, such as int [10], and specify the length of 4 to divide into int [4], int [4], int [2], and then concatenate the list |
static ArrayList<String[]> |
ArraySplitByLength(String[] array,
int length)
切割字符串数组信息
|
static byte[] |
AsciiBytesToBytes(byte[] inBytes)
将ascii格式的byte数组转换成原始的byte数组
Converts an ASCII-formatted byte array to the original byte array |
static boolean[] |
BoolArraySelectMiddle(boolean[] value,
int index,
int length)
获取到数组里面的中间指定长度的数组
Get an array of the specified length in the array |
static byte[] |
BoolArrayToByte(boolean[] array)
将bool数组转换到byte数组
Converting a bool array to a byte array |
static boolean |
BoolOnByteIndex(byte value,
int offset)
获取byte数据类型的第offset位,是否为True
Gets the index bit of the byte data type, whether it is True |
static byte[] |
BuildAsciiBytesFrom(byte value)
从字节构建一个ASCII格式的数据内容
Build an ASCII-formatted data content from bytes |
static byte[] |
BuildAsciiBytesFrom(byte[] value)
从字节数组构建一个ASCII格式的数据内容
Byte array to construct an ASCII format data content |
static byte[] |
BuildAsciiBytesFrom(int value)
从int构建一个ASCII格式的数据内容
Constructing an ASCII-formatted data content from a int |
static byte[] |
BuildAsciiBytesFrom(short value)
从short构建一个ASCII格式的数据内容
Constructing an ASCII-formatted data content from a short |
static byte[] |
BytesArrayRemoveBegin(byte[] value,
int length)
将一个数组的前后移除指定位数,返回新的一个数组
Removes the preceding specified number of bits in a array, returning a new array |
static byte[] |
BytesArrayRemoveDouble(byte[] value,
int leftLength,
int rightLength)
将一个byte数组的前后移除指定位数,返回新的一个数组
Removes a array before and after the specified number of bits, returning a new array |
static byte[] |
BytesArrayRemoveLast(byte[] value,
int length)
将一个数组的后面指定位数移除,返回新的一个数组
Removes the specified number of digits after a array, returning a new array |
static byte[] |
BytesArraySelectBegin(byte[] value,
int length)
选择一个数组的前面的几个数据信息
Select the begin few items of data information of a array |
static byte[] |
BytesArraySelectLast(byte[] value,
int length)
选择一个数组的后面的几个数据信息
Select the last few items of data information of a array |
static byte[] |
BytesArraySelectMiddle(byte[] value,
int index,
int length)
获取到数组里面的中间指定长度的数组
Get an array of the specified length in the array |
static byte[] |
BytesReverseByWord(byte[] inBytes)
将byte数组按照双字节进行反转,如果为单数的情况,则自动补齐
Reverses the byte array by double byte, or if the singular is the case, automatically |
static byte[] |
BytesToAsciiBytes(byte[] inBytes)
将原始的byte数组转换成ascii格式的byte数组
Converts the original byte array to an ASCII-formatted byte array |
static boolean[] |
ByteToBoolArray(byte[] InBytes)
从Byte数组中提取所有的位数组
Extracts a bit array from a byte array, length represents the number of digits |
static boolean[] |
ByteToBoolArray(byte[] InBytes,
int length)
从Byte数组中提取位数组,length代表位数
Extracts a bit array from a byte array, length represents the number of digits |
static String |
ByteToHexString(byte[] InBytes)
字节数据转化成16进制表示的字符串
Byte data into a string of 16 binary representations |
static String |
ByteToHexString(byte[] InBytes,
char segment)
字节数据转化成16进制表示的字符串
Byte data into a string of 16 binary representations |
static String |
ByteToHexString(byte[] InBytes,
char segment,
int newLineCount)
字节数据转化成16进制表示的字符串
Byte data into a string of 16 binary representations |
static String |
ByteToHexString(String InString)
字符串数据转化成16进制表示的字符串
String data into a string of 16 binary representations |
static String |
CalculateStreamMD5(String data)
获取文本字符串信息的Md5码,编码为UTF8
Get the Md5 code of the text string information, using the utf-8 encoding |
static String |
CalculateStreamMD5(String data,
String charsetName)
获取文本字符串信息的Md5码,使用指定的编码
Get the Md5 code of the text string information, using the specified encoding |
static String |
GetAsciiStringRender(byte[] content)
将字节数组显示为ASCII格式的字符串,当遇到0x20以下及0x7E以上的不可见字符时,使用十六进制的数据显示
Display the byte array as a string in ASCII format, when encountering invisible characters below 0x20 and above 0x7E, use hexadecimal data to display |
static String |
GetSizeDescription(long size)
从一个字节大小返回带单位的描述,主要是用于显示操作
Returns a description with units from a byte size, mainly for display operations |
static String |
GetTimeSpanDescription(long secondTicks)
从一个时间差返回带单位的描述,主要是用于显示操作。
|
static String |
GetUniqueStringByGuidAndRandom()
获取一串唯一的随机字符串,长度为20,由Guid码和4位数的随机数组成,保证字符串的唯一性
Gets a string of unique random strings with a length of 20, consisting of a GUID code and a 4-digit random number to guarantee the uniqueness of the string
|
static byte[] |
HexStringToBytes(String hex)
将16进制的字符串转化成Byte数据,将检测每2个字符转化,也就是说,中间可以是任意字符
Converts a 16-character string into byte data, which will detect every 2 characters converted, that is, the middle can be any character |
static boolean |
IsByteTokenEquel(byte[] head,
UUID token)
判断两个数据的令牌是否相等
Determines whether the tokens of two data are equals |
static boolean |
IsTwoBytesEquel(byte[] b1,
byte[] b2)
判断两个字节的指定部分是否相同
Determines whether the specified portion of a two-byte is the same |
static boolean |
IsTwoBytesEquel(byte[] b1,
int start1,
byte[] b2,
int start2,
int length)
判断两个字节数组是否是一致的,可以指定中间的某个区域
Determines whether the specified portion of a two-byte is the same |
static boolean |
IsTwoTokenEquel(UUID token1,
UUID token2)
判断两个数据的令牌是否相等
Determines whether the tokens of two data are equal |
static byte |
SetBoolOnByteIndex(byte byt,
int offset,
boolean value)
设置取byte数据类型的第offset位,是否为True
Set the offset bit of the byte data type, whether it is True |
static byte[] |
SpliceArray(byte[]... arrays)
拼接任意个泛型数组为一个总的泛型数组对象,采用深度拷贝实现。
|
static String[] |
SpliceStringArray(String first,
String[] array)
将一个string的数组和多个string类型的对象整合成一个数组
Combine an array of string and multiple objects of type string into an array |
static String[] |
SpliceStringArray(String first,
String second,
String[] array)
将两个string的数组和多个string类型的对象整合成一个数组
Combine two arrays of string and multiple objects of type string into one array |
static boolean[] |
SpliceTwoBoolArray(boolean[] bytes1,
boolean[] bytes2)
拼接2个bool数组的数据
Splicing 2 bool to to an array |
static byte[] |
SpliceTwoByteArray(byte[]... bytes)
拼接任意个字节数组为一个总的字节数组。
|
static byte[] |
SpliceTwoByteArray(byte[] bytes1,
byte[] bytes2)
拼接2个字节数组的数据
Splicing 2 bytes to to an array |
static int[] |
SplitIntegerToArray(int integer,
int everyLength)
将整数进行有效的拆分成数组,指定每个元素的最大值
Effectively split integers into arrays, specifying the maximum value for each element |
public static SystemVersion FrameworkVersion
public static String CalculateStreamMD5(String data)
data - 文本数据信息public static String CalculateStreamMD5(String data, String charsetName)
data - 文本数据信息charsetName - 编码信息public static String GetSizeDescription(long size)
size - 数据大小public static String GetTimeSpanDescription(long secondTicks)
secondTicks - 当前的秒数信息public static <T> String ArrayFormat(T[] array)
T - 数组的类型array - 数组信息public static <T> String ArrayFormat(T[] array, String format)
T - 数组的类型array - 数组信息format - 格式化的信息public static <T> String ArrayFormat(T array)
T - 数组的类型array - 数组信息public static <T> String ArrayFormat(T array, String format)
T - 数组的类型array - 数组信息format - 格式化的信息public static <T> T[] AddArrayData(Class<T> tClass, T[] array, T[] data, int max)
T - 数据类型tClass - 类型信息array - 原数据data - 等待新增的数据max - 原数据的最大值public static byte[] ArrayExpandToLength(byte[] data,
int length)
data - 原先的数据长度length - 扩充或是缩短后的长度public static byte[] ArrayExpandToLengthEven(byte[] data)
data - 原先的数据长度public static <T> T[] ArrayExpandToLength(Class<T> tClass, T[] data, int length)
T - 数组的类型data - 原先数据的数据length - 新数组的长度public static <T> T[] ArrayExpandToLengthEven(Class<T> tClass, T[] data)
T - 数组的类型data - 原先数据的数据public static <T> ArrayList<T[]> ArraySplitByLength(Class<T> tClass, T[] array, int length)
T - 数组的类型tClass - 泛型的类型array - 等待分割的数组length - 指定的长度信息public static ArrayList<byte[]> ArraySplitByLength(byte[] array, int length)
array - 数组length - 长度public static ArrayList<String[]> ArraySplitByLength(String[] array, int length)
array - 字符串的数组length - 长度信息public static int[] SplitIntegerToArray(int integer,
int everyLength)
integer - 整数信息everyLength - 单个的数组长度public static boolean IsTwoBytesEquel(byte[] b1,
int start1,
byte[] b2,
int start2,
int length)
b1 - 第一个字节数组start1 - 起始字节b2 - 第二个字节数组start2 - 起始字节length - 对比数据的长度public static boolean IsTwoBytesEquel(byte[] b1,
byte[] b2)
b1 - 第一个字节b2 - 第二个字节public static boolean IsByteTokenEquel(byte[] head,
UUID token)
head - 字节数据token - GUID数据public static boolean IsTwoTokenEquel(UUID token1, UUID token2)
token1 - 第一个令牌token2 - 第二个令牌public static String GetUniqueStringByGuidAndRandom()
public static String ByteToHexString(byte[] InBytes)
InBytes - 字节数组public static String ByteToHexString(byte[] InBytes, char segment)
InBytes - 字节数组segment - 分割符public static String ByteToHexString(byte[] InBytes, char segment, int newLineCount)
InBytes - 字节数组segment - 分割符public static String ByteToHexString(String InString) throws UnsupportedEncodingException
InString - 输入的字符串数据UnsupportedEncodingException - 不支持的编码异常public static byte[] HexStringToBytes(String hex)
hex - 16进制表示的字符串数据public static byte[] BytesReverseByWord(byte[] inBytes)
inBytes - 输入的字节信息public static String GetAsciiStringRender(byte[] content)
content - 字节数组信息public static byte[] BytesToAsciiBytes(byte[] inBytes)
inBytes - 等待转换的byte数组public static byte[] AsciiBytesToBytes(byte[] inBytes)
inBytes - 等待转换的byte数组public static byte[] BuildAsciiBytesFrom(byte value)
value - 数据public static byte[] BuildAsciiBytesFrom(short value)
value - 数据public static byte[] BuildAsciiBytesFrom(int value)
value - 数据public static byte[] BuildAsciiBytesFrom(byte[] value)
value - 字节信息public static byte[] SpliceArray(byte[]... arrays)
arrays - 任意个长度的数组public static boolean BoolOnByteIndex(byte value,
int offset)
value - byte数值offset - 索引位置public static byte SetBoolOnByteIndex(byte byt,
int offset,
boolean value)
byt - byte数值offset - 索引位置value - 写入的结果值public static byte[] BoolArrayToByte(boolean[] array)
array - bool数组public static boolean[] ByteToBoolArray(byte[] InBytes,
int length)
InBytes - 原先的字节数组length - 想要转换的长度,如果超出自动会缩小到数组最大长度public static boolean[] ByteToBoolArray(byte[] InBytes)
InBytes - 原先的字节数组public static byte[] SpliceTwoByteArray(byte[] bytes1,
byte[] bytes2)
bytes1 - 数组一bytes2 - 数组二public static boolean[] SpliceTwoBoolArray(boolean[] bytes1,
boolean[] bytes2)
bytes1 - 数组一bytes2 - 数组二public static byte[] SpliceTwoByteArray(byte[]... bytes)
bytes - 字节数组public static String[] SpliceStringArray(String first, String[] array)
first - 第一个数组对象array - 字符串数组信息public static String[] SpliceStringArray(String first, String second, String[] array)
first - 第一个数组对象second - 第二个数组对象array - 字符串数组信息public static byte[] BytesArrayRemoveBegin(byte[] value,
int length)
value - 字节数组length - 等待移除的长度public static byte[] BytesArrayRemoveLast(byte[] value,
int length)
value - 字节数组length - 等待移除的长度public static byte[] BytesArrayRemoveDouble(byte[] value,
int leftLength,
int rightLength)
value - 字节数组leftLength - 前面的位数rightLength - 后面的位数public static byte[] BytesArraySelectMiddle(byte[] value,
int index,
int length)
value - 数组index - 起始索引length - 数据的长度public static byte[] BytesArraySelectBegin(byte[] value,
int length)
value - 数组length - 数据的长度public static byte[] BytesArraySelectLast(byte[] value,
int length)
value - 数组length - 数据的长度public static boolean[] BoolArraySelectMiddle(boolean[] value,
int index,
int length)
value - 数组index - 起始索引length - 数据的长度public static <T> T[] ArrayRemoveBegin(Class<T> clazz, T[] value, int length)
value - 字节数组length - 等待移除的长度public static <T> T[] ArrayRemoveLast(Class<T> clazz, T[] value, int length)
value - 字节数组length - 等待移除的长度public static <T> T[] ArrayRemoveDouble(Class<T> clazz, T[] value, int leftLength, int rightLength)
T - 泛型类型value - 字节数组leftLength - 前面的位数rightLength - 后面的位数public static <T> T[] ArraySelectMiddle(Class<T> clazz, T[] value, int index, int length)
value - 数组index - 起始索引length - 数据的长度public static <T> T[] ArraySelectBegin(Class<T> clazz, T[] value, int length)
value - 数组length - 数据的长度public static <T> T[] ArraySelectLast(Class<T> clazz, T[] value, int length)
value - 数组length - 数据的长度Copyright © 2022. All rights reserved.