Addressing comments.
diff --git a/src/core/support/file.c b/src/core/support/file.c
index 63aa826..3a4ac6f 100644
--- a/src/core/support/file.c
+++ b/src/core/support/file.c
@@ -45,10 +45,10 @@
                         int *success) {
   unsigned char *contents = NULL;
   size_t contents_size = 0;
-  unsigned char buf[4096];
   char *error_msg = NULL;
   gpr_slice result = gpr_empty_slice();
   FILE *file = fopen(filename, "rb");
+  size_t bytes_read = 0;
 
   if (file == NULL) {
     gpr_asprintf(&error_msg, "Could not open file %s (error = %s).", filename,
@@ -56,29 +56,20 @@
     GPR_ASSERT(error_msg != NULL);
     goto end;
   }
-
-  while (1) {
-    size_t bytes_read = fread(buf, 1, sizeof(buf), file);
-    if (bytes_read > 0) {
-      contents = gpr_realloc(contents, contents_size + bytes_read);
-      memcpy(contents + contents_size, buf, bytes_read);
-      contents_size += bytes_read;
-    }
-    if (bytes_read < sizeof(buf)) {
-      if (ferror(file)) {
-        gpr_asprintf(&error_msg, "Error %s occured while reading file %s.",
-                     strerror(errno), filename);
-        GPR_ASSERT(error_msg != NULL);
-        goto end;
-      } else {
-        GPR_ASSERT(feof(file));
-        break;
-      }
-    }
+  fseek(file, 0, SEEK_END);
+  contents_size = ftell(file);
+  fseek(file, 0, SEEK_SET);
+  contents = gpr_malloc(contents_size + (add_null_terminator ? 1 : 0));
+  bytes_read = fread(contents, 1, contents_size, file);
+  if (bytes_read < contents_size) {
+    GPR_ASSERT(ferror(file));
+    gpr_asprintf(&error_msg, "Error %s occured while reading file %s.",
+                 strerror(errno), filename);
+    GPR_ASSERT(error_msg != NULL);
+    goto end;
   }
   if (success != NULL) *success = 1;
   if (add_null_terminator) {
-    contents = gpr_realloc(contents, contents_size + 1);
     contents[contents_size++] = 0;
   }
   result = gpr_slice_new(contents, contents_size, gpr_free);