private void syncAndClose(Bin bin) {
   try {
     bin.sync();
   } finally {
     bin.close();
   }
 }