ICompressedReader implementation that decompresses Zstandard (https://facebook.github.io/zstd/) data.
More...
#include <reader.hpp>
ICompressedReader implementation that decompresses Zstandard (https://facebook.github.io/zstd/) data.
Definition at line 157 of file reader.hpp.
◆ ZStdReader() [1/3]
mcap::ZStdReader::ZStdReader |
( |
| ) |
|
|
default |
◆ ZStdReader() [2/3]
mcap::ZStdReader::ZStdReader |
( |
const ZStdReader & |
| ) |
|
|
delete |
◆ ZStdReader() [3/3]
◆ DecompressAll()
static Status mcap::ZStdReader::DecompressAll |
( |
const std::byte * |
data, |
|
|
uint64_t |
compressedSize, |
|
|
uint64_t |
uncompressedSize, |
|
|
ByteArray * |
output |
|
) |
| |
|
static |
Decompresses an entire Zstd-compressed chunk into output
.
- Parameters
-
data | The Zstd-compressed input chunk. |
compressedSize | The size of the Zstd-compressed input. |
uncompressedSize | The size of the data once uncompressed. |
output | The output vector. This will be resized to uncompressedSize to fit the data, or 0 if the decompression encountered an error. |
- Returns
- Status
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read()
uint64_t mcap::ZStdReader::read |
( |
std::byte ** |
output, |
|
|
uint64_t |
offset, |
|
|
uint64_t |
size |
|
) |
| |
|
overridevirtual |
This method is called by MCAP reader classes when they need to read a portion of the file.
- Parameters
-
output | A pointer to a pointer to the buffer to write to. This method is expected to either maintain an internal buffer, read data into it, and update this pointer to point at the internal buffer, or update this pointer to point directly at the source data if possible. The pointer and data must remain valid and unmodified until the next call to read(). |
offset | The offset in bytes from the beginning of the file to read. |
size | The number of bytes to read. |
- Returns
- uint64_t Number of bytes actually read. This may be less than the requested size if the end of the file is reached. The output pointer must be readable from
output
to output + size
. If the read fails, this method should return 0.
Implements mcap::IReadable.
◆ reset()
void mcap::ZStdReader::reset |
( |
const std::byte * |
data, |
|
|
uint64_t |
size, |
|
|
uint64_t |
uncompressedSize |
|
) |
| |
|
overridevirtual |
Reset the reader state, clearing any internal buffers and state, and initialize with new compressed data.
- Parameters
-
data | Compressed data to read from. |
size | Size of the compressed data in bytes. |
uncompressedSize | Size of the data in bytes after decompression. A buffer of this size will be allocated for the uncompressed data. |
Implements mcap::ICompressedReader.
◆ size()
uint64_t mcap::ZStdReader::size |
( |
| ) |
const |
|
overridevirtual |
Returns the size of the file in bytes.
- Returns
- uint64_t The total number of bytes in the MCAP file.
Implements mcap::IReadable.
◆ status()
Status mcap::ZStdReader::status |
( |
| ) |
const |
|
overridevirtual |
◆ status_
Status mcap::ZStdReader::status_ |
|
private |
◆ uncompressedData_
ByteArray mcap::ZStdReader::uncompressedData_ |
|
private |
The documentation for this class was generated from the following file: