Skip to content

Commit

Permalink
[C#] minor update to spanbyte
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed Aug 20, 2021
1 parent 54d4c83 commit c93b769
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cs/src/core/VarLen/SpanByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ public unsafe struct SpanByte

internal IntPtr Pointer => payload;

/// <summary>
/// Get payload pointer
/// </summary>
public byte* ToPointer()
{
if (Serialized)
return MetadataSize + (byte*)Unsafe.AsPointer(ref payload);
else
return MetadataSize + (byte*)payload;
}

/// <summary>
/// Length of payload, including metadata if any
/// </summary>
Expand Down

0 comments on commit c93b769

Please sign in to comment.