Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I'm buiding a streaming video server in Windows Media Http Streaming Protocol (WMSP) with C#. I've read WMSP Specification. In Framing Header of packets as $H, $D... has 2 fields :

B (1 bit): A 1-bit flag. This flag SHOULD be set to 1 if the next packet will be sent immediately after this packet is sent. In this context, "immediately" means that the server does not intentionally introduce a delay (such as a pacing delay) between the transmission of the two packets. In all other cases, the flag MUST be 0.<56>

Frame (7 bits): A 7-bit field. This field MUST have the value 0x24. (If the B and Frame fields are treated as a single byte, the value of this byte will be 0x24 when the B field is 0, and 0xA4 when the B field is 1.)

Data type of this 2 field is bit when the smallest data type in C# is byte. So, how to declare and set value for this 2 field ?
Posted

This[^] covers every answer I can think of.
 
Share this answer
 
You can use the BitArray class as an example:-
C#
bool[] threeBools = new bool[]{true,false,false};
BitArray ba = new BitArray(threeBools);
//or
BitArray ba1 = new BitArray(7);
BitArray2 ba2 = new BitArray(7);
// Can now use methods provided BitArray class...



I hope this helps
Daxa
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900