compressWithSyncFlush

suspend fun compressWithSyncFlush(buffer: ReadBuffer, level: CompressionLevel = CompressionLevel.Default, factory: BufferFactory = BufferFactory.Default): 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.

factory

The buffer factory for the output buffer.