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

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

public static DecodeBoolean ( IBerInput input ) : bool
input IBerInput
Результат bool
        public static bool DecodeBoolean(IBerInput input)
        {
            return input.ReadByte() != 0;
        }

Usage Example

        /// <summary>
        /// Decodes the value of the current TLV as boolean.
        /// Throws an exception in case of a format mismatch.
        /// </summary>
        /// <returns>The boolean value of the current TLV.</returns>
        public bool GetBoolean()
        {
            if (IsContainer || Length == 0 || Value == null)
            {
                ThrowError(201, "Invalid Boolean encoding");
            }

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

            var input = new BerMemoryInput(Value);

            return(BerEncoding.DecodeBoolean(input));
        }
All Usage Examples Of BerLib.BerEncoding::DecodeBoolean