public boolean loadCheckpoint(InputBuffer buffer) throws IOException {
   if (buffer.readInt() != 31173) throw new RuntimeException("invalid checkpoint");
   nextSendTime = buffer.readLong();
   if (buffer.readBoolean()) {
     dest = new HandleSerializer().deserialize(buffer);
   }
   if (logger.level <= Logger.FINER) logger.log("loadCheckpoint " + nextSendTime);
   byte[] bytes = new byte[buffer.readInt()];
   buffer.read(bytes);
   ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
   try {
     rand = (Random) new ObjectInputStream(bais).readObject();
   } catch (ClassNotFoundException cnfe) {
     IOException ioe = new IOException("Error reading random number from checkpoint");
     ioe.initCause(cnfe);
     throw ioe;
   }
   if (nextSendTime > 0) {
     scheduleMessageToBeSent(nextSendTime, true);
   }
   return true;
 }