/** * Write String data to a CHAR variable, origin assumed to be 0. Must not be in define mode. * * @param v variable to write to * @param values write this array; must be ArrayObject of String * @throws IOException if I/O error * @throws ucar.ma2.InvalidRangeException if values Array has illegal shape */ public void writeStringData(Variable v, Array values) throws java.io.IOException, InvalidRangeException { writeStringData(v, new int[values.getRank()], values); }
/** * Write String data to a CHAR variable, origin assumed to be 0. Must not be in define mode. * * @param v variable to write to * @param values write this array; must be ArrayObject of String * @throws IOException if I/O error * @throws ucar.ma2.InvalidRangeException if values Array has illegal shape */ public void writeStringData(Variable v, Array values) throws java.io.IOException, InvalidRangeException { writeStringData(v, new int[values.getRank()], values); }
/** * Write String data to a CHAR variable, origin assumed to be 0. Must not be in define mode. * * @param v variable to write to * @param values write this array; must be ArrayObject of String * @throws IOException if I/O error * @throws ucar.ma2.InvalidRangeException if values Array has illegal shape */ public void writeStringData(Variable v, Array values) throws java.io.IOException, InvalidRangeException { writeStringData(v, new int[values.getRank()], values); }
private void writeProfileData(List<String> profiles) throws IOException { int nprofiles = profiles.size(); profileMap = new HashMap<String, Integer>(2 * nprofiles); if (debug) System.out.println("stationMap created"); // now write the profile data ArrayObject.D1 idArray = new ArrayObject.D1(String.class, nprofiles); for (int i = 0; i < profiles.size(); i++) { String name = profiles.get(i); profileMap.put(name, i); idArray.set(i, name); } try { writer.writeStringData(id, idArray); } catch (InvalidRangeException e) { e.printStackTrace(); throw new IllegalStateException(e); } }
writer.write(lon, lonArray); if (useAlt) writer.write(alt, altArray); writer.writeStringData(id, idArray); writer.writeStringData(desc, descArray); if (useWmoId) writer.writeStringData(wmoId, wmoArray);
ncfilew.writeStringData(tvar, data);