Skip to content

Commit

Permalink
Implemented ToReadOnlySpan
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesper Glintborg committed Jul 23, 2023
1 parent 226248a commit 52cd31e
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> ToReadOnlySpan()
{
return new ReadOnlySpan<byte>(Buffer);
}
}
}

0 comments on commit 52cd31e

Please sign in to comment.