cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java
public void write(Variable v, int[] origin, Array values) throws java.io.IOException, InvalidRangeException {
    if (defineMode)
      throw new UnsupportedOperationException("in define mode");

    spiw.writeData(v, new Section(origin, values.getShape()), values);
    v.invalidateCache();
  }
public void write(Variable v, int[] origin, Array values) throws java.io.IOException, InvalidRangeException {
    if (defineMode)
      throw new UnsupportedOperationException("in define mode");

    spiw.writeData(v, new Section(origin, values.getShape()), values);
    v.invalidateCache();
  }
Write data to the named variable. Must not be in define mode.

@param v      variable to write to
@param origin offset within the variable to start writing.
@param values write this array; must be same type and rank as Variable
@throws IOException                    if I/O error
@throws ucar.ma2.InvalidRangeException if values Array has illegal shape