Skip to content

Commit

Permalink
FilUtils - write function for stream and bytes array
Browse files Browse the repository at this point in the history
  • Loading branch information
cattaneoinfoesse committed Aug 2, 2022
1 parent 9ce24c3 commit 95e6429
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ACUtils.FileUtils/ACUtils.FileUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Authors>Andrea Cattaneo</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>1.0.0.140</Version>
<PackageVersion>1.0.0.140</PackageVersion>
<Version>1.0.0.141</Version>
<PackageVersion>1.0.0.141</PackageVersion>
<Description>Collezione di utility varie</Description>
<NeutralLanguage>it</NeutralLanguage>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
14 changes: 14 additions & 0 deletions ACUtils.FileUtils/FileUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ public static void WriteText(string filePath, string text)
File.WriteAllText(filePath, text);
}

public static Stream Write(Stream stream, string filepath)
{
var fileStream = File.Create(filepath);
stream.Seek(0, SeekOrigin.Begin);
stream.CopyTo(fileStream);
fileStream.Close();
return stream;
}

public static void Write(byte[] stream, string filepath)
{
File.WriteAllBytes(filepath, stream);
}

#endregion

#region convert
Expand Down

0 comments on commit 95e6429

Please sign in to comment.