compressWithSyncFlush

suspend fun compressWithSyncFlush(buffer: ReadBuffer, level: CompressionLevel = CompressionLevel.Default, zone: AllocationZone = AllocationZone.Direct): ReadBuffer

Compresses data using Z_SYNC_FLUSH and strips the sync marker.

This is a convenience function for protocols that need independently decompressible messages without the trailing sync marker (e.g., WebSocket permessage-deflate).

The compressed output can be decompressed using decompressWithSyncFlush.

Return

Compressed data with the sync marker stripped.

Parameters

buffer

The data to compress.

level

The compression level.

zone

The allocation zone for the output buffer.