cdm/src/main/java/ucar/nc2/NCdumpW.java
public static boolean print(NetcdfFile nc, Writer out, boolean showAll, boolean showCoords,
                              boolean ncml, boolean strict, String varNames, ucar.nc2.util.CancelTask ct) throws IOException {

    WantValues showValues = WantValues.none;
    if (showAll)
      showValues = WantValues.all;
    else if (showCoords)
      showValues = WantValues.coordsOnly;

    return print(nc, out, showValues, ncml, strict, varNames, ct);
  }
public static boolean print(NetcdfFile nc, Writer out, boolean showAll, boolean showCoords,
                              boolean ncml, boolean strict, String varNames, ucar.nc2.util.CancelTask ct) throws IOException {

    WantValues showValues = WantValues.none;
    if (showAll)
      showValues = WantValues.all;
    else if (showCoords)
      showValues = WantValues.coordsOnly;

    return print(nc, out, showValues, ncml, strict, varNames, ct);
  }
ncdump-like print of netcdf file.

@param nc         already opened NetcdfFile
@param out        print to this stream
@param showAll    dump all variable data
@param showCoords only print header and coordinate variables
@param ncml       print NcML representation (other arguments are ignored)
@param strict     print strict CDL representation
@param varNames   semicolon delimited list of variables whose data should be printed. May have
Fortran90 like selector: eg varName(1:2,*,2)
@param ct         allow task to be cancelled; may be null.
@return true if successful
@throws IOException on write error