Change BuildWriteBytesPackage to use MemoryStream.

This commit is contained in:
Serge Camille
2020-08-17 21:06:45 +02:00
parent 4ef037881c
commit 2f07d43062
3 changed files with 45 additions and 24 deletions

View File

@@ -0,0 +1,18 @@

namespace S7.Net.Helper
{
internal static class MemoryStreamExtension
{
/// <summary>
/// Helper function to write to whole content of the given byte array to a memory stream.
///
/// Writes all bytes in value from 0 to value.Length to the memory stream.
/// </summary>
/// <param name="stream"></param>
/// <param name="value"></param>
public static void WriteByteArray(this System.IO.MemoryStream stream, byte[] value)
{
stream.Write(value, 0, value.Length);
}
}
}