title: Gson with FileWriter doesn't write complete file
body: <p>I am creating an instance of <code>Gson</code> and writing with the following:</p>
  
  <pre><code>Gson gson = new GsonBuilder().setPrettyPrinting().create();
  Writer writer = new FileWriter(location);
  gson.toJson(data, writer);
  </code></pre>
  
  <p>This does write to the file, but the JSON object is incomplete and ends at line 7197 like this:</p>
  
  <pre><code>...
  {
      "type": "RockCell"
  },
  {
      "type": "Flo
  </code></pre>
  
  <p>I have tried deleting and rerunning the code and it always stops writing at line 7197 in this exact way.</p>
  
  <p>If I change the value of <code>data</code>, it ends at a different point (line 7182) but again does so consistently.</p>
  
  <p>In both cases, the files are 106,496 bytes in size. This issue still occurs if pretty printing is disabled, but the files are always 49,152 bytes.</p>