Closed brentlemons closed 3 years ago
What is in the data array?
The problem with GRIB is that it needs the GRIB index (gbx9) file in addition to the binary GRIB file. So there would have to be a special API for that, telling it to put the gbx file into memory also I suppose.
See Issue #638
version: 5.3.3 Java 11 linux and macos filesystems
Call in question:
NetcdfFile ncf = NetcdfFiles.openInMemory("s3test", data);
Exception:
openInMemory creates an InMemoryRandomAccessFile. The filename property in the InMemoryRandomAccessFile is set to the name of the dataset. When passing a byte array, this does not represent a file on the filesystem.
The raf is passed to openGribCollectionFromRaf(...). From there it is passed to openGribCollectionFromDataFile(...). Within this method, the following occurs:
dataRaf.getLocation() only points to a made up name, therefore there is no file to open. As soon as it tries to use the "file", it exceptions out with the above error.
This occurs with openInMemory using byte[] as well as URI. It doesn't happen when you openInMemory with a filename because it is later able to open the file. However, that means it is actually loading the file into memory, or randomly accessing later, the same file/data.