The 'read()' method of python file objects does not require the user specifying
the size, and allows for negative size as well. In this case it just reads
entire file. Ament TransRead to also follow this convention.
Change-Id: I3c0c645d458654711f3dc7a832aaec427d4abd00
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
self._open_compressed_file()
- def read(self, size):
+ def read(self, size = -1):
""" Read the data from the file or URL and and uncompress it on-the-fly
if necessary. """
+ if size < 0:
+ size = 0xFFFFFFFFFFFFFFFF
+
buf = self._transfile_obj.read(size)
self._pos += len(buf)