Skip to content

Commit

Permalink
Merge pull request #1069 from dxdjgl/master
Browse files Browse the repository at this point in the history
Implemented AsSpan on NetMQFrame
  • Loading branch information
drewnoakes authored Aug 7, 2023
2 parents 226248a + eb0aaad commit 41a940c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/NetMQ/NetMQFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,14 @@ public byte[] ToByteArray(bool copy = false)

return byteArray;
}

/// <summary>
/// Return an readonly span of bytes that carries the content of this NetMQFrames Buffer.
/// </summary>
/// <returns>the Buffer as a readonly span</returns>
public ReadOnlySpan<byte> AsSpan()
{
return new ReadOnlySpan<byte>(Buffer, 0, MessageSize);
}
}
}

0 comments on commit 41a940c

Please sign in to comment.