code: public synchronized Message readDatagram ()
          throws IOException, ClassNotFoundException
      {
          // read in the sequence number and determine if it's out-of-order
          int number = _uin.readInt();
          if (number <= _lastReceived) {
              return null;
          }
          _missedCount = number - _lastReceived - 1;
          _lastReceived = number;
  
          // read the acknowledge number and process all send records up to that one
          int received = _uin.readInt();
          int remove = 0;
          for (int ii = 0, nn = _sendrecs.size(); ii < nn; ii++) {
              SendRecord sendrec = _sendrecs.get(ii);
              if (sendrec.number > received) {
                  break;
              }
              remove++;
              if (sendrec.number == received) {
                  if (sendrec.mappedClasses != null) {
                      _uout.noteClassMappingsReceived(sendrec.mappedClasses);
                  }
                  if (sendrec.mappedInterns != null) {
                      _uout.noteInternMappingsReceived(sendrec.mappedInterns);
                  }
              }
          }
          if (remove > 0) {
              _sendrecs.subList(0, remove).clear();
          }
  
          // read the contents of the datagram, note the transport, and return
          Message datagram = (Message)_uin.readObject();
          datagram.setTransport(Transport.UNRELIABLE_ORDERED);
          return datagram;
      }
docs: Reads a datagram from the underlying stream.
  
  @return the contents of the datagram, or <code>null</code> if the datagram was received
  out-of-order.