Pablo Palazon wrote:
Hello!

I know that I can access to IoBuffer with byte level, I only can get 1
byte each time. Is it possible to get only 1 bit??. My problem is like
this:

I have a data format with 26 bits (3 bytes and 2 bits more), there are 5
fields (3 fields of 1 byte and 2 fields of 1 bit each one). The 2 fields
of 1 bit are in the middle. If I get this data with byte level, I'll
lost information for next messages, because I get so more information in
this messages.
Whatever you do, the bits will be transefered into bytes. It's up to you to manage the bits on the server. You won't loose anything.
I'd like to know if is possible to get only one bit in the IoBuffer,
Of course : get a byte, and using the correct mask ( byte & 0x80 for instance to get the higner bit in the byte), you will be able to get a single bit.

If you have some message finishing in the middle of a byte, then you will have to handle this by splitting the byte in two parts. This is certainly manageable.


--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to