(payload)
| 92 | |
| 93 | |
| 94 | def gzip_decode(payload): |
| 95 | buf = io.BytesIO(payload) |
| 96 | |
| 97 | # Gzip context manager introduced in python 2.7 |
| 98 | # so old-fashioned way until we decide to not support 2.6 |
| 99 | gzipper = gzip.GzipFile(fileobj=buf, mode='r') |
| 100 | try: |
| 101 | return gzipper.read() |
| 102 | finally: |
| 103 | gzipper.close() |
| 104 | |
| 105 | |
| 106 | def snappy_encode(payload, xerial_compatible=True, xerial_blocksize=32*1024): |
searching dependent graphs…