/** * close the file. * @throws IOException if I/O error */ public synchronized void close() throws java.io.IOException { if (spiw != null) { flush(); spiw.close(); spiw = null; } }
/** * close the file. * * @throws IOException if I/O error */ public synchronized void close() throws java.io.IOException { if (spiw != null) { flush(); spiw.close(); spiw = null; } }
/** * close the file. * * @throws IOException if I/O error */ public synchronized void close() throws java.io.IOException { if (spiw != null) { setRedefineMode(false); flush(); spiw.close(); spiw = null; } }
writer.flush(); writer.close(); logger.debug("File written {}", fileName);
/** * Write the input file to the output file. * @param cancel allow user to cancel; may be null. * @return the open output file. * @throws IOException */ public NetcdfFile write(CancelTask cancel) throws IOException { try { if (version.isNetdf4format()) addGroup4(null, fileIn.getRootGroup()); else addNetcdf3(); if (cancel != null && cancel.isCancel()) return null; if (debugWrite) System.out.printf("About to write = %n%s%n", writer.getNetcdfFile()); // create the file writer.create(); if (debug) System.out.printf("File Out= %n%s%n", writer.getNetcdfFile()); if (cancel != null && cancel.isCancel()) return null; double total = copyVarData(varList, null, cancel); if (cancel != null && cancel.isCancel()) return null; writer.flush(); if (debug) System.out.println("FileWriter done total bytes = " + total); } catch (IOException ioe) { writer.abort(); // clean up throw ioe; } return writer.getNetcdfFile(); }
/** * Write the input file to the output file. * @param cancel allow user to cancel; may be null. * @return the open output file. * @throws IOException */ public NetcdfFile write(CancelTask cancel) throws IOException { try { if (version.isExtendedModel()) addGroupExtended(null, fileIn.getRootGroup()); else addGroupClassic(); if (cancel != null && cancel.isCancel()) return null; // create the file writer.create(); if (cancel != null && cancel.isCancel()) return null; double total = copyVarData(varList, null, cancel); if (cancel != null && cancel.isCancel()) return null; writer.flush(); if (debug) System.out.println("FileWriter done total bytes = " + total); } catch (IOException ioe) { ioe.printStackTrace(); writer.abort(); // clean up throw ioe; } return writer.getNetcdfFile(); }
/** * Write the input file to the output file. * @param cancel allow user to cancel; may be null. * @return the open output file. * @throws IOException */ public NetcdfFile write(CancelTask cancel) throws IOException { try { if (version.isExtendedModel()) addGroupExtended(null, fileIn.getRootGroup()); else addGroupClassic(); if (cancel != null && cancel.isCancel()) return null; // create the file writer.create(); if (cancel != null && cancel.isCancel()) return null; double total = copyVarData(varList, null, cancel); if (cancel != null && cancel.isCancel()) return null; writer.flush(); if (debug) System.out.println("FileWriter done total bytes = " + total); } catch (IOException ioe) { ioe.printStackTrace(); writer.abort(); // clean up throw ioe; } return writer.getNetcdfFile(); }
writer.write( writer.findVariable(variableName), origin, variableData); writer.write( writer.findVariable(latVarName), lat_origin, latData); writer.flush();
public void alterExistingFile(String url) throws IOException { NetcdfFileWriter file = null; try { file = NetcdfFileWriter.openExisting(url); file.setRedefineMode(true); //Group rootGroup = file.getRootGroup(); //Group headerDataGroup = new Group(file, rootGroup, "header_data"); //file.addGroup(rootGroup, headerDataGroup); file.addVariable(null, newVarName, DataType.FLOAT, "z y x"); } finally { if (file != null) { file.setRedefineMode(false); file.flush(); file.close(); } } }
writer.write(bandVariable.var, originIndexing, bandVariable.matrix); writer.flush();
ncfile.flush(); if (debug) System.out.println("FileWriter done total bytes = " + total);
ncfile.flush(); if (debug) System.out.println("FileWriter done total bytes = " + total);
ncfile.flush(); if (debug) System.out.println("FileWriter done total bytes = " + total);
ncfile.flush(); System.out.println("FileWriter done total bytes = " + total); ncfile.close();
writer.flush(); } catch (IOException e) { e.printStackTrace();
ncFile.write ("jill", start, jillArray); ncFile.flush(); ncFile.close();
writer.flush(); } catch (IOException e) { e.printStackTrace();