/** closes the stream, inserting any non-written header. */
 @Override
 public void close() throws IOException {
   append();
   super.close();
 }