Creating RTCP header

Hi all,

I would like to create RTCP header [version(2bit),padding(1 bit), count(5 bit), payload(8 bit), length(16 bit), ssrc(32 bit)] in java.How can I declare 2 bit version, in case of c and c++ there is a possibility like allocating 2 bits even by using bitfield... Is anything in java like that by using shifting or any one knows how to declare 2 bits other than BitSet class since it is taking 64 bit as size even though i declare a size of 2 bit.

[464 byte] By [lkhi@123a] at [2007-11-27 5:44:46]
# 1
You'll have to use shifts and masks but once you get the data into bytes or shorts or ints you can use DataOutputStream to marshall it.
ejpa at 2007-7-12 15:25:49 > top of Java-index,Core,Core APIs...
# 2

be carefu, those RTCP fields are not signed

> [version(2bit),padding(1 bit), count(5 bit),

byte versionPaddingCount;

> payload(8 bit),

byte payload;

> length(16 bit),

byte[2] length;

> ssrc(32 bit)]

byte[4] ssrc;

and have fun with the &, |, >>, <<, and lots of 0xFF

Message was edited by:

developer_jbs

developer_jbsa at 2007-7-12 15:25:49 > top of Java-index,Core,Core APIs...