refactor(mingli-utils):重构集合工具类并添加新功能
- 重写 Collection 类,使用 Kotlin 语法和特性优化代码结构 - 添加新方法以支持数组和集合之间的转换 - 新增 CopyOnWriteArrayList、Stack 和 TreeSet 相关方法 -优化现有方法,提高代码可读性和性能 - 删除未使用的 ForEach 导入 -调整 build.gradle.kts 中的依赖项
This commit is contained in:
@@ -16,14 +16,13 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile ByteUtils.kt
|
||||
* LastUpdate 2025-09-14 19:28:38
|
||||
* LastUpdate 2025-09-15 00:07:22
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
@file:JvmName("ByteUtils")
|
||||
|
||||
package com.mingliqiye.utils.bytes
|
||||
|
||||
import com.mingliqiye.utils.collection.Lists
|
||||
import com.mingliqiye.utils.stream.SuperStream
|
||||
|
||||
const val ESC_ASC: Byte = 0x10
|
||||
@@ -42,7 +41,7 @@ const val ESC_RESERVED: Byte = 0x06
|
||||
* @return 包含每个字节对应十六进制字符串的列表
|
||||
*/
|
||||
fun ByteArray.getByteArrayString(): MutableList<String> {
|
||||
return Lists.toList(this)!!.stream()
|
||||
return this.toList().stream()
|
||||
.map { a -> String.format("0X%02X", a!!.toInt() and 0xFF) }
|
||||
.collect(SuperStream.Collectors.toList())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user