ByteUtils class

字节工具类

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

clone(Uint8List origin) Uint8List
克隆字节数组
combine({required Uint8List arrayFirst, required Uint8List arraySecond}) Uint8List
将两个字节拼接
extract({required Uint8List origin, required int indexStart, required int length}) Uint8List?
从字节序列中提取数据
fromBase64(String base64) Uint8List
转换base64字符串到字节数组
fromReadable(String readable, {Radix radix = Radix.hex}) Uint8List?
将可读字符串转换为字节数组,用空格或逗号分隔的字节。 默认的基数是十六进制,或者指定的基数 比如:'01 02, ff 0x10,0xfa , 90 76 AF a0' 输出:1, 2, 255, 16, 250, 144, 118, 175, 160
insert({required Uint8List origin, required int indexStart, required Uint8List arrayInsert}) Uint8List
在字节某个索引处插入字节
remove({required Uint8List origin, required int indexStart, required int lengthRemove}) Uint8List
在字节某个索引处移除字节
same(Uint8List bytes1, Uint8List bytes2) bool
判断两个字节是否相同
toBase64(Uint8List buffer) String
将字节数组转换为base64字符串
toReadable(Uint8List buffer, {Radix radix = Radix.hex}) String
将字节数组转换为可读字符串。 默认基数是十六进制,或指定的基数