Skip to content

Commit 41a940c

Browse files
authored
Merge pull request #1069 from dxdjgl/master
Implemented AsSpan on NetMQFrame
2 parents 226248a + eb0aaad commit 41a940c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/NetMQ/NetMQFrame.cs

+9
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,14 @@ public byte[] ToByteArray(bool copy = false)
337337

338338
return byteArray;
339339
}
340+
341+
/// <summary>
342+
/// Return an readonly span of bytes that carries the content of this NetMQFrames Buffer.
343+
/// </summary>
344+
/// <returns>the Buffer as a readonly span</returns>
345+
public ReadOnlySpan<byte> AsSpan()
346+
{
347+
return new ReadOnlySpan<byte>(Buffer, 0, MessageSize);
348+
}
340349
}
341350
}

0 commit comments

Comments
 (0)