BerLib.BerEncoding.DecodeRelativeOid C# (CSharp) Метод

DecodeRelativeOid() публичный статический Метод

public static DecodeRelativeOid ( IBerInput input, int length ) : int[]
input IBerInput
length int
Результат int[]
        public static int[] DecodeRelativeOid(IBerInput input, int length)
        {
            var subidentifiers = new List<int>();

             while(length > 0)
             {
            int count;
            subidentifiers.Add((int)DecodeMultiByteInteger(input, out count));

            length -= count;
             }

             return subidentifiers.ToArray();
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Decodes the value of the current TLV as an RelativeOid.
        /// Throws an exception in case of a format mismatch.
        /// </summary>
        /// <returns>An array of integers containing the subidentifiers of the RelativeOid value of the current TLV.</returns>
        public int[] GetRelativeOid()
        {
            if (IsContainer)
            {
                ThrowError(207, "Invalid RelativeOid encoding");
            }

            Debug.Assert(Value != null || Length == 0);
            Debug.Assert(Type == BerType.RelativeOid || BerType.IsApplicationDefined(Type));

            var input = new BerMemoryInput(Value);

            return(BerEncoding.DecodeRelativeOid(input, Length));
        }
All Usage Examples Of BerLib.BerEncoding::DecodeRelativeOid