writeAsBytes writeAsString

  • Post author:
  • Post category:其他


import 'dart:io';
import 'dart:convert';


main()async{
File a = File('C:\\aria2\\1.txt');
var c = read(a);
print(c);
var d = utf8.decode(c);
print(d);
// await a.writeAsBytes(c+'\ntest');
// print(read(a));
}

read(File a){
var b = a.readAsBytesSync();
print('================');
return b;
}




================
[116, 101, 115, 116, 116, 101, 115, 116, 10, 116, 101, 115, 116, 10, 116, 101, 115, 116]
testtest
test
test

转载于:https://www.cnblogs.com/pythonClub/p/10909947.html