code: public static long parseSegment(Name name, byte marker) throws EncodingException {
      if (name.size() == 0) {
        throw new EncodingException("No components to parse.");
      }
      return name.get(-1).toNumberWithMarker(marker);
    }
docs: Retrieve the segment number from the last component of a name.
  
  @param name the name of a packet
  @param marker the marker type (the initial byte of the component)
  @return the segment number
  @throws EncodingException if the name does not have a final component of the correct marker type