cdm/src/main/java/ucar/nc2/NetcdfFile.java
static public NetcdfFile open(String location, String iospClassName, int bufferSize, CancelTask cancelTask, Object iospMessage)
          throws ClassNotFoundException, IllegalAccessException, InstantiationException, IOException {

    Class iospClass = NetcdfFile.class.getClassLoader().loadClass(iospClassName);
    IOServiceProvider spi = (IOServiceProvider) iospClass.newInstance(); // fail fast

    // send before iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    if (bufferSize <= 0)
      bufferSize = default_buffersize;

    ucar.unidata.io.RandomAccessFile raf =
            ucar.unidata.io.RandomAccessFile.acquire(canonicalizeUriString(location), bufferSize);

    NetcdfFile result = new NetcdfFile(spi, raf, location, cancelTask);

    // send after iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    return result;
  }
static public NetcdfFile open(String location, String iospClassName, int bufferSize, CancelTask cancelTask, Object iospMessage)
          throws ClassNotFoundException, IllegalAccessException, InstantiationException, IOException {

    Class iospClass = NetcdfFile.class.getClassLoader().loadClass(iospClassName);
    IOServiceProvider spi = (IOServiceProvider) iospClass.newInstance(); // fail fast

    // send before iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    if (bufferSize <= 0)
      bufferSize = default_buffersize;

    ucar.unidata.io.RandomAccessFile raf =
            ucar.unidata.io.RandomAccessFile.acquire(canonicalizeUriString(location), bufferSize);

    NetcdfFile result = new NetcdfFile(spi, raf, location, cancelTask);

    // send after iosp is opened
    if (iospMessage != null)
      spi.sendIospMessage(iospMessage);

    return result;
  }
static public NetcdfFile open ( String location , String iospClassName , int bufferSize , CancelTask cancelTask , Object iospMessage ) throws ClassNotFoundException , IllegalAccessException , InstantiationException , IOException { Class iospClass = NetcdfFile . class . getClassLoader ( ) . loadClass ( iospClassName ) ; IOServiceProvider spi = ( IOServiceProvider ) iospClass . newInstance ( ) ; // fail fast // send before iosp is opened if ( iospMessage != null ) spi . sendIospMessage ( iospMessage ) ; if ( bufferSize <= 0 ) bufferSize = default_buffersize ; ucar . unidata . io . RandomAccessFile raf = ucar . unidata . io . RandomAccessFile . acquire ( canonicalizeUriString ( location ) , bufferSize ) ; NetcdfFile result = new NetcdfFile ( spi , raf , location , cancelTask ) ; // send after iosp is opened if ( iospMessage != null ) spi . sendIospMessage ( iospMessage ) ; return result ; }
Open an existing file (read only), specifying which IOSP is to be used.

@param location      location of file
@param iospClassName fully qualified class name of the IOSP class to handle this file
@param bufferSize    RandomAccessFile buffer size, if <= 0, use default size
@param cancelTask    allow task to be cancelled; may be null.
@param iospMessage   special iosp tweaking (sent before open is called), may be null
@return NetcdfFile object, or null if cant find IOServiceProver
@throws IOException            if read error
@throws ClassNotFoundException cannat find iospClassName in thye class path
@throws InstantiationException if class cannot be instantiated
@throws IllegalAccessException if class is not accessible
Open an existing file ( read only ) specifying which IOSP is to be used .