From b5fc25de7ccf7ba98c01c16616e1bccbfd8b9cfa Mon Sep 17 00:00:00 2001 From: Laura Gomez Date: Fri, 3 Jan 2020 15:27:31 -0500 Subject: [PATCH] feat: Added WriteAllByte method to IcdFile class. --- CHANGELOG.md | 4 +++- ICD.Common.Utils/IO/IcdFile.cs | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eef7e0..f53feff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] - +### Added + - Added WriteAllByte method on IcdFile. + ### Added - Added MathUtils methods for converting to and from percentages - Added enum extensions for finding the inclusion and exclusion of enum flags diff --git a/ICD.Common.Utils/IO/IcdFile.cs b/ICD.Common.Utils/IO/IcdFile.cs index c31696e..eff436f 100644 --- a/ICD.Common.Utils/IO/IcdFile.cs +++ b/ICD.Common.Utils/IO/IcdFile.cs @@ -100,5 +100,11 @@ namespace ICD.Common.Utils.IO { return new IcdStreamWriter(File.AppendText(path)); } + + public static void WriteAllBytes(string path, byte[] bytes) + { + using (FileStream stream = File.OpenWrite(path)) + stream.Write(bytes, 0, bytes.Length); + } } }