/// <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));
}