Skip to content

Commit 86fc159

Browse files
committed
Implement Span<byte>/ReadOnlySpan<byte> overloads
Addresses #66 .NET Core 2.1 implements Read and Write overloads that accept Span constructs. These constructs will work without overloading, but the default implementations work via inefficient byte array copies. This adds a netcoreapp2.1 target to the NuGet package, and implements efficient overloads of Read(Span<byte>) and Write(ReadOnlySpan<byte>). Overloads of ReadAsync and WriteAsync are not required, they have efficient default implementations that will use these methods as needed. The unit tests have also been updated to target .NET Core 2.1 so that they can test the new method implementations.
1 parent 9de4de0 commit 86fc159

File tree

5 files changed

+508
-4
lines changed

5 files changed

+508
-4
lines changed

UnitTests/RecyclableMemoryStreamEventListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData)
4343
this.EventWritten(eventData.EventId, (string)eventData.Payload[TagIndex]);
4444
}
4545

46-
public virtual void EventWritten(int eventId, string tag)
46+
public new virtual void EventWritten(int eventId, string tag)
4747
{
4848
switch (eventId)
4949
{

0 commit comments

Comments
 (0)