public static NetcdfFile openInMemory ( String filename ) throws IOException { File file = new File ( filename ) ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ( int ) file . length ( ) ) ; try ( InputStream in = new BufferedInputStream ( new FileInputStream ( filename ) ) ) { IO . copy ( in , bos ) ; } return openInMemory ( filename , bos . toByteArray ( ) ) ; }
Read a local CDM file into memory . All reads are then done from memory .