Patches instream using the supplied delta and write the resultantant data to outstream.
(instream, outstream, delta)
| 138 | |
| 139 | |
| 140 | def patchstream(instream, outstream, delta): |
| 141 | """ |
| 142 | Patches instream using the supplied delta and write the resultantant |
| 143 | data to outstream. |
| 144 | """ |
| 145 | blocksize = delta[0] |
| 146 | |
| 147 | for element in delta[1:]: |
| 148 | if isinstance(element, int) and blocksize: |
| 149 | instream.seek(element * blocksize) |
| 150 | element = instream.read(blocksize) |
| 151 | outstream.write(element) |
| 152 | |
| 153 | |
| 154 | def rollingchecksum(removed, new, a, b, blocksize=4096): |