writeBytes method
void
writeBytes()
override
Writes content
to a file at filePath
.
If a file is to be overwritten, a warning will be reported, unless
allowOverwrite
is true
.
Implementation
@override
void writeBytes(
String filePath,
List<int> content, {
bool allowOverwrite = false,
}) {
_validateMaxWriteStats(filePath, content.length);
// Replace '/' separators with proper separators for the platform.
var outFile = path.joinAll(filePath.split('/'));
if (!allowOverwrite) {
_warnAboutOverwrite(outFile, null);
}
_fileElementMap[outFile] = null;
var file = _getFile(outFile);
file.writeAsBytesSync(content);
writtenFiles.add(outFile);
logProgress(outFile);
}