compressBuffer
fn
ubyte[] compressBuffer(const(ubyte)[] input, CompressionOptions opts = CompressionOptions.init, string providerName = null)Convenience: compress a whole buffer using GC allocations. Not suitable for untrusted gigantic inputs.
fn
ubyte[] compressBuffer(CompressionFormat fmt, const(ubyte)[] input, string providerName = null)Convenience: compress a whole buffer with just a format specification.
This is a simpler overload when you only need to specify the compression format without additional options like level or strategy.
Parameters
fmt | The compression format to use. |
input | Uncompressed data to compress. |
providerName | Optional provider name; if null, the highest-priority provider is used. |
Returns
Compressed data as a new buffer.
Throws
CompressionError if compression fails or no provider is registered for the format.