bool NextBool() { Next(); if (io.IsUnsigned()) { return(io.ValueUnsigned != 0); } else if (io.IsSigned()) { return((uint)io.ValueSigned != 0); } else if (io.IsBoolean()) { return((bool)io.ValueBoolean); } else { throw new Error(ErrorCode.TYPE_MISMATCH, "Got type: " + io.Type); } }