以int为例
///小端转大端
final littleData = ByteData(4);
littleData.setInt32(0, 59, Endian.little);
print("大端:${littleData.getInt32(0, Endian.big)}");
///大端转小端
final bigData = ByteData(4);
bigData.setInt32(0, 98, Endian.big);
print("小端:${bigData.getInt32(0, Endian.little)}");
网友评论