Skip to content

Commit

Permalink
Add new Stream extension to write a byte array easily
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo committed Dec 3, 2019
1 parent 5a5b1a0 commit d628be2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions OpenKh.Common/StreamExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public static int WriteList<T>(this Stream stream, IEnumerable<T> items)
return (int)stream.Position - oldPosition;
}

public static void Write(this Stream stream, byte[] data) =>
stream.Write(data, 0, data.Length);

public static int Write(this Stream stream, IEnumerable<int> items)
{
var oldPosition = (int)stream.Position;
Expand Down

0 comments on commit d628be2

Please sign in to comment.