code: def write(self, data):
          
          self._check_can_write()
          compressed = self._compressor.compress(data)
          self._fp.write(compressed)
          self._pos += len(data)
          return len(data)
docs: Write a bytes object to the file.
  
          Returns the number of uncompressed bytes written, which is
          always len(data). Note that due to buffering, the file on disk
          may not reflect the data written until close() is called.