Exemplo n.º 1
0
 def update(self, b):  # pylint: disable=method-hidden,invalid-name
     """Compress data given in b, returning compressed result either from this function or writing to fp). Note:
        sometimes output might be zero length (if being buffered by lz4).
        Raises Lz4FramedNoDataError if input is of zero length."""
     with self.__lock:
         output = compress_update(self.__ctx, b)
         if self.__write:
             self.__write(self.__header)
             self.__header = None
             self.__write(output)
             self.update = self.__updateNextWrite
         else:
             header = self.__header
             self.__header = None
             self.update = self.__updateNextReturn
             return header + output
Exemplo n.º 2
0
 def update(self, b):  # pylint: disable=method-hidden,invalid-name
     """Compress data given in b, returning compressed result either from this function or writing to fp). Note:
        sometimes output might be zero length (if being buffered by lz4).
        Raises Lz4FramedNoDataError if input is of zero length."""
     with self.__lock:
         output = compress_update(self.__ctx, b)
         if self.__write:
             self.__write(self.__header)
             self.__header = None
             self.__write(output)
             self.update = self.__updateNextWrite
         else:
             header = self.__header
             self.__header = None
             self.update = self.__updateNextReturn
             return header + output
Exemplo n.º 3
0
 def __updateNextReturn(self, b):  # pylint: disable=invalid-name
     return compress_update(self.__ctx, b)
Exemplo n.º 4
0
 def __updateNextWrite(self, b):  # pylint: disable=invalid-name
     self.__write(compress_update(self.__ctx, b))
Exemplo n.º 5
0
 def __updateNextReturn(self, b):  # pylint: disable=invalid-name
     return compress_update(self.__ctx, b)
Exemplo n.º 6
0
 def __updateNextWrite(self, b):  # pylint: disable=invalid-name
     self.__write(compress_update(self.__ctx, b))