Message6576
For anyone interested, below is our compress implementation. It's not fully generic (i.e. doesn't allow setting compression level) but works great for us.
from java.util.zip import Deflater
import jarray
DEFLATOR = Deflater(9, False)
def compress(text):
DEFLATOR.setInput(text)
DEFLATOR.finish()
buf = jarray.zeros(1024, 'b')
compressed = []
while not DEFLATOR.finished():
length = DEFLATOR.deflate(buf, 0, 1024)
compressed.append(buf[:length].tostring())
DEFLATOR.reset()
return ''.join(compressed) |
|
Date |
User |
Action |
Args |
2011-07-22 07:30:22 | pekka.klarck | set | messageid: <1311319822.25.0.58288119205.issue1775@psf.upfronthosting.co.za> |
2011-07-22 07:30:22 | pekka.klarck | set | recipients:
+ pekka.klarck |
2011-07-22 07:30:22 | pekka.klarck | link | issue1775 messages |
2011-07-22 07:30:21 | pekka.klarck | create | |
|