dcsimg
How can I serizalize an object that must containt an unknow number of bits?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, April 25, 2002 09:12 AM

I must serializate an object that must represent a bits sequence with variable length (they can be 53 bits, 48 bits, 55 bits, etc.). I must send this serialized object across TCP/IP to a client that is listening. At the client, I mus check the value of all bits, for example, if bit 5th is 0 or 1 or if the first eight bits are 00h or FFh. Please, how must I declare the class to send this information? I think that use an array of Bytes is not a solution, due to the number of bits that I send can not be a multiple of eight, and the number of bits to transmit is not fixed. Many thinks.    More>>

I must serializate an object that must represent a bits sequence with variable length (they can be 53 bits, 48 bits, 55 bits, etc.).

I must send this serialized object across TCP/IP to a client that is listening. At the client, I mus check the value of all bits, for example, if bit 5th is 0 or 1 or if the first eight bits are 00h or FFh.


Please, how must I declare the class to send this information?


I think that use an array of Bytes is not a solution, due to the number of bits that I send can not be a multiple of eight, and the number of bits to transmit is not fixed.


Many thinks.

   <<Less

Re: How can I serizalize an object that must containt an unknow number of bits?

Posted By:   Anonymous  
Posted On:   Thursday, April 25, 2002 10:03 AM

Could you just use an array of bytes and keep the total count of bits in a seperate field?? Like ...

Class toto {

int iCount;

byte[] byteArray;

}


Another solution would be to use an array of booleans...
About | Sitemap | Contact