self.uncomp_data = indata
if self.compress != 'none':
self.uncomp_size = len(indata)
- data = comp_util.compress(indata, self.compress)
+ data = comp_util.compress(indata, self.compress, with_header=False)
return data
def DecompressData(self, indata):
Returns:
Decompressed data
"""
- data = comp_util.decompress(indata, self.compress)
+ data = comp_util.decompress(indata, self.compress, with_header=False)
if self.compress != 'none':
self.uncomp_size = len(data)
self.uncomp_data = data
self._ResetDtbs()
def _decompress(self, data):
- return comp_util.decompress(data, 'lz4')
+ return comp_util.decompress(data, 'lz4', with_header=False)
def testCompress(self):
"""Test compression of blobs"""
rest = base[len(U_BOOT_DATA):]
# Check compressed data
- expect1 = comp_util.compress(COMPRESS_DATA + U_BOOT_DATA, 'lz4')
+ expect1 = comp_util.compress(COMPRESS_DATA + U_BOOT_DATA, 'lz4',
+ with_header=False)
data1 = rest[:len(expect1)]
section1 = self._decompress(data1)
self.assertEquals(expect1, data1)
self.assertEquals(COMPRESS_DATA + U_BOOT_DATA, section1)
rest1 = rest[len(expect1):]
- expect2 = comp_util.compress(COMPRESS_DATA + COMPRESS_DATA, 'lz4')
+ expect2 = comp_util.compress(COMPRESS_DATA + COMPRESS_DATA, 'lz4',
+ with_header=False)
data2 = rest1[:len(expect2)]
section2 = self._decompress(data2)
self.assertEquals(expect2, data2)
def testInvalidCompress(self):
with self.assertRaises(ValueError) as e:
- comp_util.compress(b'', 'invalid')
+ comp_util.compress(b'', 'invalid', with_header=False)
self.assertIn("Unknown algorithm 'invalid'", str(e.exception))
with self.assertRaises(ValueError) as e:
- comp_util.decompress(b'1234', 'invalid')
+ comp_util.decompress(b'1234', 'invalid', with_header=False)
self.assertIn("Unknown algorithm 'invalid'", str(e.exception))
def testBintoolDocs(self):