public override ReadOnlySpan <byte> Marshal() { var buffer = new NdrBuffer(); buffer.MarshalObject(this); return(buffer.ToSpan(alignment: 8)); }
public override ReadOnlyMemory <byte> Marshal() { using (var buffer = new NdrBuffer()) { buffer.MarshalObject(this); return(buffer.ToMemory(alignment: 8)); } }
private static ReadOnlySpan <byte> Compress(ClaimsSet claimsSet, CompressionFormat compressionFormat, out int originalSize) { var buffer = new NdrBuffer(); buffer.MarshalObject(claimsSet); ReadOnlySpan <byte> encoded = buffer.ToSpan(alignment: 8); originalSize = encoded.Length; if (compressionFormat != CompressionFormat.COMPRESSION_FORMAT_NONE) { encoded = Compressions.Compress(encoded, compressionFormat); } return(encoded); }