how to write a single bit to an output device

I抦 wondering if there is a way to write a single bit out to a physical device. The BitOutputStream can accept a single bit, but when it writes to the OutputStream, it appears to be handled as a byte. Even 2 bits gets stuffed into a byte and padded.

I抦 trying to do some very high speed switching and want to be able to control bits from one at a time, to streaming any number until I change the value of the bit. The physical device will detect the shift.

Any suggestions?

[491 byte] By [herbka] at [2007-11-27 5:26:43]
# 1
> I抦 wondering if there is a way to write a single bit> out to a physical device. Well Java isn't physically sending anything to any device. So....It might help if you clarified what this device is and what API is being used to send data to it.
cotton.ma at 2007-7-12 14:47:45 > top of Java-index,Java Essentials,Java Programming...
# 2

Thanks for the reply cotton,

Since a serial port can handle a stream of bits of any number within the frame, I can write a driver that can handle the stream to the output device (which in this case is a PIC microprocessor dedicated to sensing the bit state and 'flipping the switch' when it changes). I am trying not to handle reading the byte at the device end to speed things up. Again, I'm not so familiar with Java at this level and it seems it only outputs in bytes, and the driver has to sample and read the byte with all the associated overhead (start stop etc)

herbka at 2007-7-12 14:47:45 > top of Java-index,Java Essentials,Java Programming...