Don't assume that we're at start of file at ctor time
BackupDataReader / BackupDataWriter were implicitly assuming that when instantiated, the underlying fd was positioned at start-of-file. If one tried to e.g. open an existing data stream to append further data to it, things might randomly fail (at read time, possibly when consuming the stream later) due to incorrect alignment of the data entities: the appending writer would assume that no padding was needed to achieve correct alignment, and this might easily be false. Now the underlying native reader/writer helpers recognize the true position within the file when constructed, and as a result it's now safe to e.g. construct a BackupDataOutput for an existing file and then append to it. Change-Id: If0484921e687852f923a4b4efabff573a6c16981
Loading
Please register or sign in to comment