39 #include "console_bridge/console.h" 46 :
Stream(file), block_size_id_(6) {
62 throw BagException(
"cannot start writing to already opened lz4 stream");
80 throw BagException(
"cannot write to unopened lz4 stream");
99 throw BagIOException(
"ROSLZ4_OUTPUT_SMALL: output buffer is too small");
135 throw BagException(
"cannot start reading from already opened lz4 stream");
146 throw BagException(
"Too many unused bytes to decompress");
158 throw BagException(
"cannot read from unopened lz4 stream");
192 throw BagIOException(
"Reached end of file before reaching end of stream");
213 unsigned int actual_dest_len = dest_len;
215 (
char*)dest, &actual_dest_len);
224 if (actual_dest_len != dest_len) {
225 throw BagException(
"Decompression size mismatch in LZ4 chunk");
const int ROSLZ4_MEMORY_ERROR
uint64_t getCompressedIn()
LZ4Stream(ChunkedFile *file)
ChunkedFile reads and writes files which contain interleaved chunks of compressed and uncompressed da...
void setUnusedLength(int nUnused)
Base class for rosbag exceptions.
const int ROSLZ4_OUTPUT_SMALL
void roslz4_decompressEnd(roslz4_stream *str)
void read(void *ptr, size_t size)
void write(void *ptr, size_t size)
void decompress(uint8_t *dest, unsigned int dest_len, uint8_t *source, unsigned int source_len)
int roslz4_compress(roslz4_stream *str, int action)
void roslz4_compressEnd(roslz4_stream *str)
const int ROSLZ4_STREAM_END
void advanceOffset(uint64_t nbytes)
const int ROSLZ4_PARAM_ERROR
Exception thrown when on IO problems.
int roslz4_decompressStart(roslz4_stream *str)
const int ROSLZ4_DATA_ERROR
void setCompressedIn(uint64_t nbytes)
void setUnused(char *unused)
void writeStream(int action)
int roslz4_decompress(roslz4_stream *str)
int roslz4_compressStart(roslz4_stream *str, int block_size_id)
CompressionType getCompressionType() const
int roslz4_blockSizeFromIndex(int block_id)
int roslz4_buffToBuffDecompress(char *input, unsigned int input_size, char *output, unsigned int *output_size)