660 @param pos position to insert the byte at |
660 @param pos position to insert the byte at |
661 @type int |
661 @type int |
662 @param ch byte to insert |
662 @param ch byte to insert |
663 @type int in the range 0x00 to 0xff |
663 @type int in the range 0x00 to 0xff |
664 """ |
664 """ |
665 assert ch in range(0, 256) |
665 if ch in range(0, 256): |
666 |
666 self.__undoStack.insert(pos, ch) |
667 self.__undoStack.insert(pos, ch) |
667 self.__refresh() |
668 self.__refresh() |
|
669 |
668 |
670 def remove(self, pos, length=1): |
669 def remove(self, pos, length=1): |
671 """ |
670 """ |
672 Public method to remove bytes. |
671 Public method to remove bytes. |
673 |
672 |
686 @param pos position to replace the byte at |
685 @param pos position to replace the byte at |
687 @type int |
686 @type int |
688 @param ch byte to replace with |
687 @param ch byte to replace with |
689 @type int in the range 0x00 to 0xff |
688 @type int in the range 0x00 to 0xff |
690 """ |
689 """ |
691 assert ch in range(0, 256) |
690 if ch in range(0, 256): |
692 |
691 self.__undoStack.overwrite(pos, ch) |
693 self.__undoStack.overwrite(pos, ch) |
692 self.__refresh() |
694 self.__refresh() |
|
695 |
693 |
696 def insertByteArray(self, pos, byteArray): |
694 def insertByteArray(self, pos, byteArray): |
697 """ |
695 """ |
698 Public method to insert bytes. |
696 Public method to insert bytes. |
699 |
697 |