RtcpBye extends RtcpHeader { protected int decode(byte[] rawData, int offSet) { int tmp = offSet; offSet = super.decode(rawData, offSet); for (int i = 0; i < this.count; i++) { this.ssrcs[i] |= rawData[offSet++] & 0xFF; this.ssrcs[i] <<= 8; this.ssrcs[i] |= rawData[offSet++] & 0xFF; this.ssrcs[i] <<= 8; this.ssrcs[i] |= rawData[offSet++] & 0xFF; this.ssrcs[i] <<= 8; this.ssrcs[i] |= rawData[offSet++] & 0xFF; } return offSet; } protected  RtcpBye();  RtcpBye(boolean padding); void addSsrc(long ssrc); long[] getSsrcs(); @Override String toString();  }
@Test public void testDecode() { RtcpBye rtcpBye = new RtcpBye(); int length = rtcpBye.decode(p, 0); assertEquals(p.length, length); assertEquals(2, rtcpBye.getVersion()); assertFalse(rtcpBye.isPadding()); assertEquals(1, rtcpBye.getCount()); assertEquals(RtcpHeader.RTCP_BYE, rtcpBye.getPacketType()); long ssrc = rtcpBye.getSsrcs()[0]; assertEquals(1448293446, ssrc); assertEquals(8, rtcpBye.getLength()); }