Fix oat_writer to use WriteData which updates checksum.

OatWriter was using WriteFully in some places instead.

Bug: 28874264
Change-Id: Ibaea4536a7838f49feb98efe9c00a976fb5b2453
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc
index e804bee..41d30fd 100644
--- a/compiler/oat_writer.cc
+++ b/compiler/oat_writer.cc
@@ -2007,7 +2007,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;
@@ -2187,7 +2187,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;