code: def ParseFileObject(self, parser_mediator, file_object):
      
      file_offset = 0
  
      try:
        timestamp, event_data = self._ReadEntry(
            parser_mediator, file_object, file_offset)
      except errors.ParseError as exception:
        raise errors.UnableToParseFile(
            'Unable to parse first utmp entry with error: {0!s}'.format(
                exception))
  
      if not event_data.username:
        raise errors.UnableToParseFile(
            'Unable to parse first utmp entry with error: missing username')
  
      if not timestamp:
        raise errors.UnableToParseFile(
            'Unable to parse first utmp entry with error: missing timestamp')
  
      date_time = dfdatetime_posix_time.PosixTimeInMicroseconds(
          timestamp=timestamp)
      event = time_events.DateTimeValuesEvent(
          date_time, definitions.TIME_DESCRIPTION_START)
      parser_mediator.ProduceEventWithEventData(event, event_data)
  
      file_offset = file_object.tell()
      file_size = file_object.get_size()
  
      while file_offset < file_size:
        if parser_mediator.abort:
          break
  
        try:
          timestamp, event_data = self._ReadEntry(
              parser_mediator, file_object, file_offset)
        except errors.ParseError:
          # Note that the utmp file can contain trailing data.
          break
  
        date_time = dfdatetime_posix_time.PosixTimeInMicroseconds(
            timestamp=timestamp)
        event = time_events.DateTimeValuesEvent(
            date_time, definitions.TIME_DESCRIPTION_START)
        parser_mediator.ProduceEventWithEventData(event, event_data)
  
        file_offset = file_object.tell()
docs: Parses an utmp file-like object.
  
      Args:
        parser_mediator (ParserMediator): mediates interactions between parsers
            and other components, such as storage and dfvfs.
        file_object (dfvfs.FileIO): a file-like object.
  
      Raises:
        UnableToParseFile: when the file cannot be parsed.