Pass the size of the new file to the PatchWriterInterface::Init()

Most patch formats include the size of the new file in the header.
To help streaming the patch to disk while generating it, this CL
passes the size of the new file to the patch writer on initialization.

To do this, we also move the Init() call to the patch writer to the
DiffEncoder, which makes more sense since the Close() call is also made
from the DiffEnconder.

Bug: None
Test: Updated tests to check for this value.
Change-Id: Idfaedbd492d68ab6e6cb2c1cb3883947f068c3aa
diff --git a/split_patch_writer.h b/split_patch_writer.h
index 5aaabce..395f999 100644
--- a/split_patch_writer.h
+++ b/split_patch_writer.h
@@ -33,7 +33,7 @@
   // corresponding AddControlEntry() is not supported and will fail. The reason
   // for this is because which underlying patch takes the bytes depends on the
   // control entries.
-  bool Init() override;
+  bool Init(size_t new_size) override;
   bool WriteDiffStream(const uint8_t* data, size_t size) override;
   bool WriteExtraStream(const uint8_t* data, size_t size) override;
   bool AddControlEntry(const ControlEntry& entry) override;
@@ -53,6 +53,9 @@
                      const uint8_t* data,
                      size_t size);
 
+  // The size of the new file for the patch we are writing.
+  size_t new_size_{0};
+
   // The size of each chunk of the new file written to.
   uint64_t new_chunk_size_;
   std::vector<PatchWriterInterface*> patches_;