39 #include "console_bridge/console.h" 65 throw BagException(
"Error opening file for writing compressed stream");
80 case BZ_IO_ERROR:
throw BagException(
"BZ_IO_ERROR: error writing the compressed file");
91 unsigned int nbytes_in;
92 unsigned int nbytes_out;
110 throw BagException(
"Error opening file for reading compressed stream");
139 case BZ_IO_ERROR:
throw BagIOException(
"BZ_IO_ERROR: error reading from compressed stream");
break;
140 case BZ_UNEXPECTED_EOF:
throw BagIOException(
"BZ_UNEXPECTED_EOF: compressed stream ended before logical end-of-stream detected");
break;
141 case BZ_DATA_ERROR:
throw BagIOException(
"BZ_DATA_ERROR: data integrity error detected in compressed stream");
break;
142 case BZ_DATA_ERROR_MAGIC:
throw BagIOException(
"BZ_DATA_ERROR_MAGIC: stream does not begin with requisite header bytes");
break;
143 case BZ_MEM_ERROR:
throw BagIOException(
"BZ_MEM_ERROR: insufficient memory available");
break;
160 int result = BZ2_bzBuffToBuffDecompress((
char*) dest, &dest_len, (
char*) source, source_len, 0,
verbosity_);
164 case BZ_CONFIG_ERROR:
throw BagException(
"library has been mis-compiled");
break;
165 case BZ_PARAM_ERROR:
throw BagException(
"dest is NULL or destLen is NULL or small != 0 && small != 1 or verbosity < 0 or verbosity > 4");
break;
166 case BZ_MEM_ERROR:
throw BagException(
"insufficient memory is available");
break;
167 case BZ_OUTBUFF_FULL:
throw BagException(
"size of the compressed data exceeds *destLen");
break;
168 case BZ_DATA_ERROR:
throw BagException(
"data integrity error was detected in the compressed data");
break;
169 case BZ_DATA_ERROR_MAGIC:
throw BagException(
"compressed data doesn't begin with the right magic bytes");
break;
170 case BZ_UNEXPECTED_EOF:
throw BagException(
"compressed data ends unexpectedly");
break;
uint64_t getCompressedIn()
ChunkedFile reads and writes files which contain interleaved chunks of compressed and uncompressed da...
void setUnusedLength(int nUnused)
int verbosity_
level of debugging output (0-4; 0 default). 0 is silent, 4 is max verbose debugging output ...
void decompress(uint8_t *dest, unsigned int dest_len, uint8_t *source, unsigned int source_len)
BZ2Stream(ChunkedFile *file)
Base class for rosbag exceptions.
void write(void *ptr, size_t size)
int block_size_100k_
compression block size (1-9; 9 default). 9 is best compression, most memory
void advanceOffset(uint64_t nbytes)
Exception thrown when on IO problems.
int work_factor_
compression behavior for worst case, highly repetitive data (0-250; 30 default)
CompressionType getCompressionType() const
void setCompressedIn(uint64_t nbytes)
BZFILE * bzfile_
bzlib compressed file stream
void setUnused(char *unused)
int bzerror_
last error from bzlib
void read(void *ptr, size_t size)