RtcpSdesItem { protected int decode(byte[] rawData, int offSet) { this.type = rawData[offSet++] & 0xFF; if (type == RtcpSdesItem.RTCP_SDES_END) { while (offSet < rawData.length) { if (rawData[offSet] != 0x00) { break; } offSet++; } return offSet; } this.length = (short) rawData[offSet++] & 0xFF; byte[] chunkData = new byte[length]; System.arraycopy(rawData, offSet, chunkData, 0, length); this.text = new String(chunkData); offSet += length; return offSet; } RtcpSdesItem(short type, String text); protected  RtcpSdesItem(); int getType(); int getLength(); String getText(); @Override String toString(); static final short RTCP_SDES_END; static final short RTCP_SDES_CNAME; static final short RTCP_SDES_NAME; static final short RTCP_SDES_EMAIL; static final short RTCP_SDES_PHONE; static final short RTCP_SDES_LOC; static final short RTCP_SDES_TOOL; static final short RTCP_SDES_NOTE; static final short RTCP_SDES_PRIV; }
@Test public void testDecode() { RtcpSdesItem rtcpSdesItem = new RtcpSdesItem(); rtcpSdesItem.decode(p, 0); assertEquals(1, rtcpSdesItem.getType()); assertEquals(14, rtcpSdesItem.getLength()); assertEquals("QTSS1262189851", rtcpSdesItem.getText()); }