Bug 1260241 - Pre: Allow to read from DeflatedFile instances. r?glandium
This allows to interrogate the data in a Jarrer.
MozReview-Commit-ID: 4TrwZxGMALH
--- a/python/mozbuild/mozpack/files.py
+++ b/python/mozbuild/mozpack/files.py
@@ -500,16 +500,21 @@ class DeflatedFile(BaseFile):
from mozpack.mozjar import JarFileReader
assert isinstance(file, JarFileReader)
self.file = file
def open(self):
self.file.seek(0)
return self.file
+ def read(self):
+ '''Return the contents of the file.'''
+ self.file.seek(0)
+ return self.file.read()
+
class XPTFile(GeneratedFile):
'''
File class for a linked XPT file. It takes several XPT files as input
(using the add() and remove() member functions), and links them at copy()
time.
'''
def __init__(self):