1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Change some file writes to UnbufferedFileStream

This commit is contained in:
disarray2077 2021-08-01 17:29:01 -03:00
parent e5f92fb21b
commit 3a1c0a3452

View file

@ -49,7 +49,7 @@ namespace System.IO
public static Result<void> WriteAll(StringView path, Span<uint8> data, bool doAppend = false)
{
FileStream fs = scope FileStream();
UnbufferedFileStream fs = scope UnbufferedFileStream();
var result = fs.Open(path, doAppend ? .Append : .Create, .Write);
if (result case .Err)
return .Err;
@ -76,7 +76,7 @@ namespace System.IO
public static Result<void> WriteAllText(StringView path, StringView text, bool doAppend = false)
{
FileStream fs = scope FileStream();
UnbufferedFileStream fs = scope UnbufferedFileStream();
var result = fs.Open(path, doAppend ? .Append : .Create, .Write);
if (result case .Err)
return .Err;
@ -87,7 +87,7 @@ namespace System.IO
public static Result<void> WriteAllText(StringView path, StringView text, Encoding encoding)
{
FileStream fs = scope FileStream();
UnbufferedFileStream fs = scope UnbufferedFileStream();
int len = encoding.GetEncodedSize(text);
uint8* data = new uint8[len]*;