(encoder, block_bytes, compression_level)
Write block in "deflate" codec.
Write block in "deflate" codec.
Write block in deflate codec .
def deflate_write_block(encoder, block_bytes, compression_level):
    """Write block in "deflate" codec."""
    # The first two characters and last character are zlib
    # wrappers around deflate data.
    if compression_level is not None:
        data = zlib.compress(block_bytes, compression_level)[2:-1]
    else:
        data = zlib.compress(block_bytes)[2:-1]
    encoder.write_long(len(data))
    encoder._fo.write(data)
def deflate_write_block ( encoder , block_bytes , compression_level ) : # The first two characters and last character are zlib # wrappers around deflate data. if compression_level is not None : data = zlib . compress ( block_bytes , compression_level ) [ 2 : - 1 ] else : data = zlib . compress ( block_bytes ) [ 2 : - 1 ] encoder . write_long ( len ( data ) ) encoder . _fo . write ( data )