--- intelhex-orig.py Thu Apr 26 18:53:46 2007 +++ intelhex.py Thu Apr 26 18:53:46 2007 @@ -185,9 +185,28 @@ @param fobj file name or file-like object @param offset starting address offset - """ - raise NotImplementedError - + """ + + if not hasattr(fobj, "read"): + fobj = file(fobj, "rb") + fclose = fobj.close + else: + fclose = None + + try: + bin = fobj.read() + + self._offset = offset + addr = offset + + for b in bin: + self._buf[addr] = b + addr+=1 + + finally: + if fclose: + fclose() + def loadfile(self, fobj, format): """Load data file into internal buffer.