ZlibAPI

interface ZlibAPI : NodeAPI

Node API: Zlib

Implements routines for compressing and decompressing data with various algorithms, including Deflate, Gzip, Zip, and Brotli. This API is available through the zlib module.

Properties

Link copied to clipboard

Returns an object containing commonly-used constants exposed by the underlying zlib implementation.

Functions

Link copied to clipboard
abstract fun brotliCompress(buffer: ZlibBuffer, options: BrotliOptions? = null, cbk: CompressCallback)
open fun brotliCompress(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously compresses the given buffer using the Brotli algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun brotliCompressSync(buffer: ZlibBuffer, options: BrotliOptions? = null): ZlibBuffer
open fun brotliCompressSync(buffer: Value?, options: Value? = null): ZlibBuffer

Synchronously compresses the given buffer using the Brotli algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun brotliDecompress(buffer: ZlibBuffer, options: BrotliOptions? = null, cbk: CompressCallback)
open fun brotliDecompress(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously decompresses the given buffer using the Brotli algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun brotliDecompressSync(buffer: ZlibBuffer, options: BrotliOptions? = null): ZlibBuffer
open fun brotliDecompressSync(buffer: Value?, options: Value? = null): ZlibBuffer

Synchronously decompresses the given buffer using the Brotli algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun crc32(data: ByteArray, value: ULong): Long

Calculates the CRC32 checksum of the given data.

open fun crc32(data: Value?, value: Value? = null): Long

Calculates the CRC32 checksum of the given data; this method variant operates on foreign Value instances.

Link copied to clipboard
open fun createBrotliCompress(options: Value? = null): BrotliCompress

Creates an instance of the BrotliCompress object, using the provided options, if any.

Link copied to clipboard
open fun createBrotliDecompress(options: Value? = null): BrotliDecompress

Creates an instance of the BrotliDecompress object, using the provided options, if any.

Link copied to clipboard
abstract fun createDeflate(options: ZlibOptions): Deflate
open fun createDeflate(options: Value? = null): Deflate

Creates an instance of the Deflate object, using the provided options, if any.

Link copied to clipboard
abstract fun createInflate(options: ZlibOptions): Inflate
open fun createInflate(options: Value? = null): Inflate

Creates an instance of the Inflate object, using the provided options, if any.

Link copied to clipboard
abstract fun createUnzip(options: ZlibOptions): Unzip
open fun createUnzip(options: Value? = null): Unzip

Creates an instance of the Unzip object, using the provided options, if any.

Link copied to clipboard
abstract fun deflate(buffer: ZlibBuffer, options: ZlibOptions? = null, cbk: CompressCallback)
open fun deflate(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously compresses the given buffer using the DEFLATE algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun deflateSync(buffer: ZlibBuffer, options: ZlibOptions? = null): ZlibBuffer
open fun deflateSync(buffer: Value?, options: Value? = null): ZlibBuffer

Synchronously compresses the given buffer using the DEFLATE algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun gunzip(buffer: ZlibBuffer, options: ZlibOptions? = null, cbk: CompressCallback)
open fun gunzip(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously decompresses the given buffer using the gunzip algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun gunzipSync(buffer: ZlibBuffer, options: ZlibOptions? = null): ZlibBuffer
open fun gunzipSync(buffer: Value?, options: Value? = null): ZlibBuffer

Synchronously decompresses the given buffer using the GZIP algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun gzip(buffer: ZlibBuffer, options: ZlibOptions? = null, cbk: CompressCallback)
open fun gzip(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously compresses the given buffer using the gzip algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun gzipSync(buffer: ZlibBuffer, options: ZlibOptions? = null): ZlibBuffer
open fun gzipSync(buffer: Value?, options: Value? = null): ByteBuffer

Synchronously compresses the given buffer using the GZIP algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun inflate(buffer: ZlibBuffer, options: ZlibOptions? = null, cbk: CompressCallback)
open fun inflate(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously decompresses the given buffer using the DEFLATE algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun inflateSync(buffer: ZlibBuffer, options: ZlibOptions? = null): ZlibBuffer
open fun inflateSync(buffer: Value?, options: Value? = null): ZlibBuffer

Synchronously decompresses the given buffer using the DEFLATE algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun unzip(buffer: ZlibBuffer, options: ZlibOptions? = null, cbk: CompressCallback)
open fun unzip(buffer: Value, options: Value? = null, cbk: Value)

Asynchronously decompresses the given buffer using the zip algorithm; apply the provided options, or use defaults if no options are specified.

Link copied to clipboard
abstract fun unzipSync(buffer: ZlibBuffer, options: ZlibOptions? = null): ZlibBuffer
open fun unzipSync(buffer: Value?, options: Value? = null): ZlibBuffer

Synchronously decompresses the given buffer using the Zip algorithm; apply the provided options, or use defaults if no options are specified.