class Compressor

Defined at line 32 of file ../../src/storage/blobfs/compression/compressor.h

A `Compressor` is used to compress whole blobs transparently. Note that compressors may add

metadata beyond the underlying compression archive format so long as the corresponding

`Decompressor` correctly interprets the metadata and archive. Addition of metadata should not

break the symmetry of `Compressor`/`Decompressor` or `Compressor`/`SeekableDecompressor` pairs.

Informally:

alpha_decompressor.Decompress(alpha_compressor.Compress(data)) == data

and

alpha_seekable_decompressor.Decompress(alpha_compressor.Compress(data), len, offset)

== data[offset : offset + len)

assuming 0

<

= offset

<

length(data), 0

<

= len, offset + len

<

= length(data). The `Compressor`,

`Decompressor`, and `SeekableDecompressor` APIs actually operate over pairs of buffers. See API

method documentation for details.

Public Methods

void Compressor ()

Defined at line 34 of file ../../src/storage/blobfs/compression/compressor.h

void ~Compressor ()

Defined at line 35 of file ../../src/storage/blobfs/compression/compressor.h

void Compressor (const Compressor & )

Defined at line 36 of file ../../src/storage/blobfs/compression/compressor.h

void Compressor (Compressor && )

Defined at line 36 of file ../../src/storage/blobfs/compression/compressor.h

size_t Size ()

Returns the compressed size of the data so far. Simply starting initialization

may result in a nonzero |Size()|.

zx_status_t Update (const void * input_data, size_t input_length)

Continues the compression after initialization.

zx_status_t End ()

Finishes the compression process.

Must be called before compression is considered complete.

Compressor & operator= (const Compressor & )

Defined at line 36 of file ../../src/storage/blobfs/compression/compressor.h

Compressor & operator= (Compressor && )

Defined at line 36 of file ../../src/storage/blobfs/compression/compressor.h

size_t GetChunkSize ()

Returns a minimum chunk size that would be appropriate when decompressing to avoid a serious

performance penalty.

Defined at line 51 of file ../../src/storage/blobfs/compression/compressor.h