flutter开发问题 dart数据类型转化 字符串 整形 ASCII转成字节集合 组合在一起用Uint8List来存

import ‘dart:convert’;
import ‘dart:typed_data’;

void main() {
var listString = Utf8Encoder().convert(‘HCC’);
var listInt = [111, 20, 33, 41, 25, 25, 25, 25, 25, 787,0x02,0x4F];
var int2utf8 = Uint8List.fromList(listInt);

var listall = listString+int2utf8;
Uint8List last = Uint8List.fromList(listall);

print(listall);
print(last.elementAt(0));
print(last.sublist(1));
}

你可能感兴趣的:(flutter)