示例#1
0
        public override ReadOnlySpan <byte> Marshal()
        {
            var buffer = new NdrBuffer();

            buffer.MarshalObject(this);

            return(buffer.ToSpan(alignment: 8));
        }
示例#2
0
        public override ReadOnlyMemory <byte> Marshal()
        {
            using (var buffer = new NdrBuffer())
            {
                buffer.MarshalObject(this);

                return(buffer.ToMemory(alignment: 8));
            }
        }
示例#3
0
        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);
        }