}
ListIterator iter = packets.listIterator();
if (!iter.hasNext()) {
throw new IllegalValueException("UdpUnreliable: empty RTP/I ADU");
}
RtpiDataPacket packet = (RtpiDataPacket) iter.next();
if (packet.getFragmentCount()!=0) {
throw new IllegalValueException("UdpUnreliable: fragment count of the first packet is not 0");
}
int sequenceNumber=packet.getSequenceNumber();
int fragmentCount=packet.getFragmentCount();
int type=packet.getType();
int payloadType=packet.getPayloadType();
int priority=packet.getPriority();
int participantID=packet.getParticipantID();
long subcomponentID=packet.getSubcomponentID();
long timestamp=packet.getTimestamp();
while (iter.hasNext()) {
packet=(RtpiDataPacket) iter.next();
if (sequenceNumber!=packet.getSequenceNumber()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different sequence numbers");
}
if (((++fragmentCount)%0x0000FFFF)!=packet.getFragmentCount()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have non contiguous fragment counts");
}
if (type!=packet.getType()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different types");
}
if (payloadType!=packet.getPayloadType()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different payload types");
}
if (priority!=packet.getPriority()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different priorities");
}
if (participantID!=packet.getParticipantID()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different paticipant IDs");
}
if (subcomponentID!=packet.getSubcomponentID()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different sub-component IDs");
}
if (timestamp!=packet.getTimestamp()) {
throw new IllegalValueException("UdpUnreliable: packets of the same RTP/I ADU have different timestamps");
}
}
if (packet.getEnd()!=1) {
throw new IllegalValueException("UdpUnreliable: end bit not set in last packet of RTP/I ADU");
}
messages.put(new Message(Message.TRANSMIT_RTPI_ADU, packets));
}