Skip to content

Commit c552d0d

Browse files
scott-xuRob-Hague
andauthored
Ref System.Memory for net462 and netstandard2.0 (#1417)
* Ref System.Memory for net462 and netstandard2.0. Use System.Buffers.Binary.BinaryPrimitives instead of Renci.SshNet.Common.Pack * Remove unnecessary `AsSpan()` * Apply suggestions from code review * that's what I get for being lazy --------- Co-authored-by: Rob Hague <[email protected]> Co-authored-by: Robert Hague <[email protected]>
1 parent 8e8829e commit c552d0d

File tree

12 files changed

+64
-530
lines changed

12 files changed

+64
-530
lines changed

src/Renci.SshNet/Common/DerData.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Buffers.Binary;
23
using System.Collections.Generic;
34

45
namespace Renci.SshNet.Common
@@ -198,7 +199,8 @@ public void Write(bool data)
198199
/// <param name="data">UInt32 data to write.</param>
199200
public void Write(uint data)
200201
{
201-
var bytes = Pack.UInt32ToBigEndian(data);
202+
var bytes = new byte[sizeof(uint)];
203+
BinaryPrimitives.WriteUInt32BigEndian(bytes, data);
202204
_data.Add(Integer);
203205
var length = GetLength(bytes.Length);
204206
WriteBytes(length);

src/Renci.SshNet/Common/Pack.cs

Lines changed: 0 additions & 282 deletions
This file was deleted.

0 commit comments

Comments
 (0)