Beispiel #1
0
 def encode(self, flash):
     """Encodes the given *flash* as a zlib compressed JSON string.
     """
     return zlib.compress(JSONCodecClass.encode(self, flash))
Beispiel #2
0
 def decode(self, encoded_flash):
     """Restores the *flash* from the given zlib compressed JSON string.
     """
     return JSONCodecClass.decode(self, zlib.decompress(encoded_flash))
Beispiel #3
0
 def __init__(self):
     """Returns a new JSON/zlib-based codec.
     """
     JSONCodecClass.__init__(self)