code: def _packto(self, stream):
          '''
          Pack current struct into stream. For parser internal use.
          
          :param stream: a buffered stream (File or BytesIO)
          
          :return: packed bytes length
          '''
          #self._logger.log(logging.DEBUG, 'packing %r', self)
          total_size = 0
          current = self
          while current is not None:
              total_size += current._parser.packto(current, stream)
              last = current
              current = getattr(current, '_sub', None)
          if hasattr(last, '_extra'):
              _extra = last._extra
              total_size += stream.write(_extra)
          return total_sizf _packto(self, stream):
          '''
          Pack current struct into stream. For parser internal use.
          
          :param stream: a buffered stream (File or BytesIO)
          
          :return: packed bytes length
          '''
          #self._logger.log(logging.DEBUG, 'packing %r', self)
          total_size = 0
          current = self
          while current is not None:
              total_size += current._parser.packto(current, stream)
              last = current
              current = getattr(current, '_sub', None)
          if hasattr(last, '_extra'):
              _extra = last._extra
              total_size += stream.write(_extra)
          return total_size
docs: Pack current struct into stream. For parser internal use.
          
          :param stream: a buffered stream (File or BytesIO)
          
          :return: packed bytes length