mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
Change BuildWriteBytesPackage to use MemoryStream.
This commit is contained in:
18
S7.Net/Helper/MemoryStreamExtension.cs
Normal file
18
S7.Net/Helper/MemoryStreamExtension.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user