39 #include "console_bridge/console.h" 50 :
Stream(file), block_size_id_(6) {
66 throw BagException(
"cannot start writing to already opened lz4 stream");
84 throw BagException(
"cannot write to unopened lz4 stream");
103 throw BagIOException(
"ROSLZ4_OUTPUT_SMALL: output buffer is too small");
139 throw BagException(
"cannot start reading from already opened lz4 stream");
150 throw BagException(
"Too many unused bytes to decompress");
162 throw BagException(
"cannot read from unopened lz4 stream");
196 throw BagIOException(
"Reached end of file before reaching end of stream");
217 unsigned int actual_dest_len = dest_len;
219 (
char*)dest, &actual_dest_len);
228 if (actual_dest_len != dest_len) {
229 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...
#define CONSOLE_BRIDGE_logError(fmt,...)
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)