Skip to content

Commit

Permalink
Refactor FromArray
Browse files Browse the repository at this point in the history
  • Loading branch information
engineering87 committed Oct 6, 2024
1 parent cf9197a commit 20408bf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions SharpHelpers/SharpHelpers/StreamHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ public static Stream FromString(this string stringToConvert)
/// <param name="arrayToConvert"></param>
/// <returns></returns>
public static Stream FromArray(this byte[] arrayToConvert)
{
var stream = new MemoryStream(arrayToConvert.Length);
stream.Write(arrayToConvert, 0, arrayToConvert.Length);
stream.Position = 0;
return stream;
{
return new MemoryStream(arrayToConvert, writable: false);
}

/// <summary>
Expand Down

0 comments on commit 20408bf

Please sign in to comment.