Writes a single bit, given by the least significant bit of the argument, to the stream at the current bit offset within the current byte position. The upper 31 bits of the argument are ignored. The given bit replaces the previous bit at that position. The bit offset is advanced by one and reduced modulo 8.
If any bits of a particular byte have never been set at the time the byte is flushed to the destination, those bits will be set to 0 automatically.
@param bit an int
whose least significant bitis to be written to the stream.
@exception IOException if an I/O error occurs.