RtcpReportBlock { protected int encode(byte[] rawData, int offSet) { rawData[offSet++] = ((byte) ((this.ssrc & 0xFF000000) >> 24)); rawData[offSet++] = ((byte) ((this.ssrc & 0x00FF0000) >> 16)); rawData[offSet++] = ((byte) ((this.ssrc & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.ssrc & 0x000000FF))); rawData[offSet++] = ((byte) ((this.fraction & 0x000000FF))); rawData[offSet++] = ((byte) ((this.lost & 0x00FF0000) >> 16)); rawData[offSet++] = ((byte) ((this.lost & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.lost & 0x000000FF))); rawData[offSet++] = ((byte) ((this.SeqNumCycle & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.SeqNumCycle & 0x000000FF))); rawData[offSet++] = ((byte) ((this.lastSeq & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.lastSeq & 0x000000FF))); rawData[offSet++] = ((byte) ((this.jitter & 0xFF000000) >> 24)); rawData[offSet++] = ((byte) ((this.jitter & 0x00FF0000) >> 16)); rawData[offSet++] = ((byte) ((this.jitter & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.jitter & 0x000000FF))); rawData[offSet++] = ((byte) ((this.lsr & 0xFF000000) >> 24)); rawData[offSet++] = ((byte) ((this.lsr & 0x00FF0000) >> 16)); rawData[offSet++] = ((byte) ((this.lsr & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.lsr & 0x000000FF))); rawData[offSet++] = ((byte) ((this.dlsr & 0xFF000000) >> 24)); rawData[offSet++] = ((byte) ((this.dlsr & 0x00FF0000) >> 16)); rawData[offSet++] = ((byte) ((this.dlsr & 0x0000FF00) >> 8)); rawData[offSet++] = ((byte) ((this.dlsr & 0x000000FF))); return offSet; } protected  RtcpReportBlock();  RtcpReportBlock(long ssrc, int fraction, int lost, int SeqNumCycle, long lastSeq, int jitter, long lsr, long dlsr); long getSsrc(); int getFraction(); int getLost(); int getSeqNumCycle(); long getLastSeq(); int getJitter(); long getLsr(); long getDlsr(); @Override String toString();  }
@Test public void testEncode() { RtcpReportBlock rr = new RtcpReportBlock(266283887, 0, 0, 0, 17250, 57, 4221306863l, 263851); byte[] rawData = new byte[256]; int length = rr.encode(rawData, 0); assertEquals(p.length, length); for (int i = 0; i < p.length; i++) { assertEquals(p[i], rawData[i]); } }