Created
August 17, 2013 11:34
-
-
Save aperezdc/6256491 to your computer and use it in GitHub Desktop.
Simple flate decoder, can be used e.g. for compression object streams in PDF files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# vim:fenc=utf-8 | |
# | |
# Copyright © 2013 Adrian Perez <[email protected]> | |
# Distributed under terms of the MIT license. | |
import zlib | |
import sys | |
if len(sys.argv) != 3: | |
raise SystemExit("Usage: " + sys.argv[0] + " input output") | |
with open(sys.argv[1], "rb") as ifd: | |
with open(sys.argv[2], "wb") as ofd: | |
ofd.write(zlib.decompress(ifd.read())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment