[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[THREDDS #ICY-921665]: Error generated using NetcdfFile.openInMemory



Hi Leakha:

use 

    URL url = new URL( location);
    byte[] contents = IO.readContentsToByteArray(url.openStream());
    NetcdfFile.openInMemory(uri.toString(), contents);

IO is currently in thredds.util package, but will move to ucar.nc2.util in 
version 4.0. I will also add a new method in 4.0:

  /**
   * Read a remote CDM file into memory. All reads are then done from memory.
   * @param uri location of CDM file, must be accessible through 
uri.toURL().openStream().
   * @return a NetcdfFile, which is completely in memory
   * @throws IOException if error reading file
   */
  public static NetcdfFile openInMemory(URI uri) throws IOException;

Ticket Details
===================
Ticket ID: ICY-921665
Department: Support THREDDS
Priority: Normal
Status: Closed