def decode(self, file):
        fStart = file.tell()
        
        identifier = None
        try:
            identifier = self.iEIEncoder.decode(file)
        except UDHInformationElementIdentifierUnknownError:
            #Continue parsing after this so that these can be ignored
            pass
        
        length = self.int8Encoder.decode(file)
        data = None
        if identifier in self.dataEncoders:
            data = self.dataEncoders[identifier].decode(file)
        elif length > 0:
            data = self.read(file, length)
            
        parsed = file.tell() - fStart
        if parsed != length + 2:
            raise UDHParseError("Invalid length: expected %d, parsed %d" % (length + 2, parsed))
        
        if identifier is None:
            return None
        
        return gsm_types.InformationElement(identifier, data)
dataset/ETHPy150Open jookies/jasmin/jasmin/vendor/smpp/pdu/gsm_encoding.py/InformationElementEncoder.decode/original