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

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

public static DecodeUtf8String ( IBerInput input, int length ) : string
input IBerInput
length int
Результат string
        public static string DecodeUtf8String(IBerInput input, int length)
        {
            var intLength = (int)length;
             var bytes = ReadString(input, ref intLength);

             return Encoding.UTF8.GetString(bytes, 0, intLength);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Decodes the value of the current TLV an UTF-8 string.
        /// Throws an exception in case of a format mismatch.
        /// </summary>
        /// <returns>The string value of the current TLV.</returns>
        public string GetString()
        {
            if (IsContainer)
            {
                ThrowError(205, "Invalid String encoding");
            }

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

            var input = new BerMemoryInput(Value);

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