internal override void DecodeBuffer(byte[] buffer, int index, int count)
        {
            NativeClaimsSetMetadata = PacUtility.NdrUnmarshal <PAC_CLIENT_CLAIMS_INFO>(
                buffer,
                index,
                count,
                FormatString.OffsetClientClaim, false, 4);

            byte[] decompressed    = null;
            int    decompressedLen = -1;

            if (NativeClaimsSetMetadata.Claims.usCompressionFormat != CLAIMS_COMPRESSION_FORMAT.COMPRESSION_FORMAT_NONE)
            {
                decompressed = ClaimsCompression.Decompress(NativeClaimsSetMetadata.Claims.usCompressionFormat,
                                                            NativeClaimsSetMetadata.Claims.ClaimsSet,
                                                            (int)NativeClaimsSetMetadata.Claims.ulUncompressedClaimsSetSize);
                decompressedLen = decompressed.Length;
            }
            else
            {
                decompressed    = NativeClaimsSetMetadata.Claims.ClaimsSet;
                decompressedLen = (int)NativeClaimsSetMetadata.Claims.ulClaimsSetSize;
            }
            NativeClaimSet = PacUtility.NdrUnmarshal <CLAIMS_SET>(
                decompressed,
                0,
                decompressedLen,
                FormatString.OffsetClaimSet, false, 4);
        }
        internal override void DecodeBuffer(byte[] buffer, int index, int count)
        {
            byte[] RawData = new byte[count];
            Array.ConstrainedCopy(buffer, index, RawData, 0, count);

            NativeClaimsSetMetadata = PacUtility.NdrUnmarshal <PAC_DEVICE_CLAIMS_INFO>(
                buffer,
                index,
                count,
                FormatString.OffsetClientClaim, false, 4);

            byte[] decompressed    = null;
            int    decompressedLen = -1;

            if (NativeClaimsSetMetadata.Claims.usCompressionFormat != CLAIMS_COMPRESSION_FORMAT.COMPRESSION_FORMAT_NONE)
            {
                uint err = ClaimsCompression.Decompress(NativeClaimsSetMetadata.Claims.usCompressionFormat,
                                                        NativeClaimsSetMetadata.Claims.ClaimsSet,
                                                        (int)NativeClaimsSetMetadata.Claims.ulUncompressedClaimsSetSize,
                                                        out decompressed);
                if (err != 0)
                {
                    throw new Exception("Failed to decompress CLAIMS_SET data, error code is :" + err);
                }
                decompressedLen = decompressed.Length;
            }
            else
            {
                decompressed    = NativeClaimsSetMetadata.Claims.ClaimsSet;
                decompressedLen = (int)NativeClaimsSetMetadata.Claims.ulClaimsSetSize;
            }
            NativeClaimSet = PacUtility.NdrUnmarshal <CLAIMS_SET>(
                decompressed,
                0,
                decompressedLen,
                FormatString.OffsetClaimSet, false, 4);
        }