code: def _encode(self):
          
          data = ByteBuffer()
          if not hasattr(self, '__fields__'):
              return data.tostring()
  
          for field in self.__fields__:
              field.encode(self, data)
          return data.tostring()
docs: Encode the message and return a bytestring.