python module StringIO.
python module zlib.
file random access.