Add a boolean value to the stream.

        :param bool b: boolean value to add
496537
def add_boolean(self, b):
        
        if b:
            self.packet.write(one_byte)
        else:
            self.packet.write(zero_byte)
        return self
503295
public static ByteBuf copyBoolean(boolean value) {
        ByteBuf buf = buffer(1);
        buf.writeBoolean(value);
        return buf;
    }
1320236
def _cast_boolean(value):
    
    _BOOLEANS = {'1': True, 'yes': True, 'true': True, 'on': True,
                 '0': False, 'no': False, 'false': False, 'off': False, '': False}
    value = str(value)
    if value.lower() not in _BOOLEANS:
        raise ValueError('Not a boolean: %s' % value)

    return _BOOLEANS[value.lower()]
816116
def parse_boolean(value):
    

    if value is None:
        return None

    if isinstance(value, bool):
        return value

    if isinstance(value, string_types):
        value = value.lower()
        if value == 'false':
            return False
        if value == 'true':
            return True

    raise ValueError("Could not convert value to boolean: {}".format(value))
1143466
public void writeBoolean(boolean value) throws UnsupportedEncodingException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeBoolean", Boolean.valueOf(value));
    getBodyList().add(Boolean.valueOf(value));
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "writeBoolean");
  }
193284
public synchronized PacketBuilder withBoolean(final boolean b)
    {
        checkBuilt();
        try
        {
            dataOutputStream.writeBoolean(b);
        }
        catch (final IOException e)
        {
            logger.error("Unable to add boolean: {} : {}", e.getClass(), e.getMessage());
        }
        return this;
    }
795380
def to_boolean_with_default(value, default_value):
        
        result = BooleanConverter.to_nullable_boolean(value)
        return result if result != None else default_value
573942
void writeBoolean(boolean value) throws IOException {
        if (value) {
            output.writeByte(TRUE);
        } else {
            output.writeByte(FALSE);
        }
    }
1078248
public final void mBOOL() throws RecognitionException {
        try {
            int _type = BOOL;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // com/dyuproject/protostuff/parser/ProtoLexer.g:203:5: ( 'bool' )
            // com/dyuproject/protostuff/parser/ProtoLexer.g:203:9: 'bool'
            {
            match("bool"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
717971
public BooleanType castToBoolean(Base b) throws FHIRException {
		if (b instanceof BooleanType)
			return (BooleanType) b;
		else
			throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Boolean");
	}
910354
public void print(boolean b) throws IOException
    {   
        if(this._listener!= null &&  !checkIfCalledFromWLonError()){   
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())    
                Tr.debug(tc, "non blocking print boolean , WriteListener enabled: " + this._listener);       
            _outHelper.print_NonBlocking(Boolean.toString(b));
        }
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())    
                Tr.debug(tc, "print boolean");        
            String value = Boolean.toString(b);
            this.write(value.getBytes(), 0, value.length()); 
        }
    }
152666
@Override
	public long writeBooleans(boolean value, long count) {
		count = Math.min(count, size - position - bufferSize);
		if (count == 0) return 0;

		final int bits = value ? -1 : 0;
		long c = count;
		while (c >= 32) {
			flushBuffer();
			bufferBits = bits;
			bufferSize = 32;
			c -= 32;
		}

		int d = (int) c;
		if (d == 0) {
			/* do nothing */
		} else if (bufferSize == 0) {
			bufferBits = bits;
			bufferSize = d;
		} else if (bufferSize + d <= 32) {
			bufferBits <<= d;
			if (value) bufferBits |= preMask(d);
			bufferSize += d;
		} else {
			flushBuffer();
			bufferBits = bits;
			bufferSize = d;
		}

		return count;
	}
658739
def add_binary(self, data, address=0, overwrite=False):
        

        address *= self.word_size_bytes
        self._segments.add(_Segment(address,
                                    address + len(data),
                                    bytearray(data),
                                    self.word_size_bytes),
                           overwrite)
15932
def writeBytes(self, b):
        
        self.stream.write(TYPE_STRING)

        self.serialiseBytes(b)
658382
public static byte setBooleanToByte(byte modifiers, int i, boolean bool) {
        boolean old = getBooleanFromByte(modifiers, i);
        if (old && !bool) { // true-->false
            return (byte) (modifiers - (1 << i));
        } else if (!old && bool) { // false-->true
            return (byte) (modifiers + (1 << i));
        }
        return modifiers;
    }
1103342
function Boolean(value) {
	spec.Asn1Spec.call(this, new spec.Asn1Tag(spec.TagClass.Universal, spec.TagFormat.Primitive, UniversalTag.Boolean));
	this.value = value || false;
}
487372
public static java.lang.Boolean boxToBoolean(boolean b) {
        return java.lang.Boolean.valueOf(b);
    }