Fix oat_writer to use WriteData which updates checksum.

OatWriter was using WriteFully in some places instead.

Bug: 28874264

(cherry-picked from commit 5e7cbde3100b0bfb58277accc9d71a94636ea727)

Change-Id: I7dac3ad0597c210ba6e12e0cc1670277d7a28fc7
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc
index 140db0c..1aa2609 100644
--- a/compiler/oat_writer.cc
+++ b/compiler/oat_writer.cc
@@ -2013,7 +2013,7 @@
   DCHECK(ValidateDexFileHeader(dex_file, oat_dex_file->GetLocation()));
   const UnalignedDexFileHeader* header = AsUnalignedDexFileHeader(dex_file);
 
-  if (!rodata->WriteFully(dex_file, header->file_size_)) {
+  if (!WriteData(rodata, dex_file, header->file_size_)) {
     PLOG(ERROR) << "Failed to write dex file " << oat_dex_file->GetLocation()
                 << " to " << rodata->GetLocation();
     return false;
@@ -2193,7 +2193,7 @@
       0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u
   };
   DCHECK_LE(aligned_code_delta, sizeof(kPadding));
-  if (UNLIKELY(!out->WriteFully(kPadding, aligned_code_delta))) {
+  if (UNLIKELY(!WriteData(out, kPadding, aligned_code_delta))) {
     return false;
   }
   size_code_alignment_ += aligned_code_delta;