cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java
public synchronized void close() throws java.io.IOException {
    if (spiw != null) {
      setRedefineMode(false);
      flush();
      spiw.close();
      spiw = null;
    }
  }
public synchronized void close() throws java.io.IOException {
    if (spiw != null) {
      setRedefineMode(false);
      flush();
      spiw.close();
      spiw = null;
    }
  }
close the file.

@throws IOException if I/O error