Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions FileSystem/FileIOLinux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ public byte[] ReadAllBytes(string filePath)
}
}

/// <inheritdoc />
public void WriteAllBytes(string filePath, byte[] bytes)
{
File.WriteAllBytes(filePath, bytes);
}

/// <inheritdoc />
public string ReadAllText(string filePath)
{
Expand Down
7 changes: 7 additions & 0 deletions FileSystem/FileIOWin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ public byte[] ReadAllBytes(string filePath)
}
}

/// <inheritdoc />
public void WriteAllBytes(string filePath, byte[] bytes)
{
TryAllowWritesOnFile(filePath);
File.WriteAllBytes(filePath, bytes);
}

/// <inheritdoc />
public string ReadAllText(string filePath)
{
Expand Down
7 changes: 7 additions & 0 deletions FileSystem/IFileIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ public interface IFileIO
/// <returns>A byte array containing the contents of the file.</returns>
byte[] ReadAllBytes(string filePath);

/// <summary>
/// Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
/// </summary>
/// <param name="filePath">Path to the file.</param>
/// <param name="bytes">The bytes to write to the file.</param>
void WriteAllBytes(string filePath, byte[] bytes);

/// <summary>
/// Reads all text in a file. If file does not exist it will return an empty string.
/// </summary>
Expand Down