(self, val)
| 156 | # to get to an aligned offset. Return pair |
| 157 | # (starting offset of val, len(val)) |
| 158 | def _addval(self, val): |
| 159 | with _io.open(self._datfile, 'rb+') as f: |
| 160 | f.seek(0, 2) |
| 161 | pos = int(f.tell()) |
| 162 | npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE |
| 163 | f.write(b'\0'*(npos-pos)) |
| 164 | pos = npos |
| 165 | f.write(val) |
| 166 | return (pos, len(val)) |
| 167 | |
| 168 | # Write val to the data file, starting at offset pos. The caller |
| 169 | # is responsible for ensuring that there's enough room starting at |
no test coverage detected