Skip to content

Commit

Permalink
Implemented AsSpan
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesper Glintborg committed Jul 24, 2023
1 parent 226248a commit eb0aaad
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 eb0aaad

Please sign in to comment.