class SeekableDecompressor

Defined at line 30 of file ../../src/storage/blobfs/compression/seekable_decompressor.h

A `SeekableDecompressor` is used to decompress parts of blobs transparently. See `Compressor`

documentation for properties of `Compressor`/`SeekableDecompressor` pair implementations.

Implementations must be thread-safe.

Public Methods

zx_status_t DecompressRange (void * uncompressed_buf, size_t * uncompressed_size, const void * compressed_buf, size_t max_compressed_size, size_t offset)

Decompresses data archive from buffer, `compressed_buf`, which has size `max_compressed_size`,

starting at _uncompressed_ byte offset, `offset`. Decompress at most `uncompressed_size` bytes.

The actual archive contents is at most `max_compressed_size`, but may be smaller. Decompressed

data is written to `uncompressed_buf`, which has a size of `*uncompressed_size`. If the return

value is `ZX_OK, then the number of bytes written is written to `uncompressed_buf` is stored in

`*uncompressed_size`.

zx::result<CompressionMapping> MappingForDecompressedRange (size_t offset, size_t len, size_t max_len)

Looks up the range [offset, offset+len) in the decompressed space, and returns a mapping which

describes the range of bytes to decompress which will contain the target range.

`max_len` is the maximum length the returned decompressed range will span, and

must be greater than zero.

The concrete implementation is free to return an arbitrarily large range of bytes as long as it

is less than or equal to `max_len`. The returned decompressed range is guaranteed

to contain `offset` but its length might be less than `len` if it was trimmed to a smaller

`max_len`.

The implementation should also ensure that the compressed data does not exceed

`max_len`, and callers may rely on this. One would hope that this is normally the

case (since that is the point of compression), but it's technically possible for compressed

data to take up more space than its uncompressed form.

void SeekableDecompressor ()

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

void ~SeekableDecompressor ()

Defined at line 33 of file ../../src/storage/blobfs/compression/seekable_decompressor.h

void SeekableDecompressor (const SeekableDecompressor & )

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

void SeekableDecompressor (SeekableDecompressor && )

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

CompressionAlgorithm algorithm ()

Returns the CompressionAlgorithm that this SeekableDecompressor supports.

SeekableDecompressor & operator= (const SeekableDecompressor & )

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

SeekableDecompressor & operator= (SeekableDecompressor && )

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