NoDataValues[0] = parentArray.getNoDataValue();
String value = (String) null; if (parentArray.getNoDataValue() != null) { value = parentArray.getNoDataValue().toString(); } NoDataValues[0] = value;
  public void toXMLOutputStream (                                   OutputStream outputstream,                                   Hashtable XMLDeclAttribs,                                   String strIndent,                                   boolean dontCloseNode,                                   String newNodeNameString,                                   String noChildObjectNodeName                                )  {    boolean writeHrefAttribute = false;    boolean niceOutput = Specification.getInstance().isPrettyXDFOutput();    String indent = "";    String nodeName = getClassXDFNodeName();    if (newNodeNameString != null) nodeName = newNodeNameString;    // indent up one     indent = indent + strIndent;    //open node    if (niceOutput)      writeOut(outputstream, indent);    writeOut(outputstream, "<" + nodeName );    Href hrefObj = getHref();    //write out just the data    XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle();    OutputStream dataOutputStream = outputstream;    if (hrefObj !=null) {  //write out to another file,      String fileName = hrefObj.getSysId();      String hrefName = hrefObj.getName();      if(hrefName == null)       {        Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n");      }       else if (fileName != null)      {         writeHrefAttribute = true;         try {            dataOutputStream = new FileOutputStream(hrefObj.getSysId());         }         catch (IOException e) {            //oops, something. is wrong, writ out to the passed in OutputStream            Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n");            writeHrefAttribute = false;         }      }       else       {            Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file.");            Log.warnln("Data are being written into metadata instead.\n");            writeHrefAttribute = false;      }    }    else {      // no *href* attribute specified, write out to the passed in OutputStream      // dataOutputStream = outputstream; // not needed now     }    // write data node attributes    if (writeHrefAttribute) {      writeOut(outputstream, " "+HREF_XML_ATTRIBUTE_NAME+"=\"");      writeOutAttribute(outputstream, hrefObj.getName());      writeOut(outputstream, "\"");    }    String checksum = getChecksum();    if (checksum != null) {        writeOut(outputstream, " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\"");      writeOutAttribute(outputstream, checksum.toString());      writeOut(outputstream, "\"");    }    String encoding = getEncoding();    if (encoding!= null) {        writeOut(outputstream, " "+ENCODING_XML_ATTRIBUTE_NAME+"=\"");      writeOutAttribute(outputstream, encoding.toString());      writeOut(outputstream, "\"");    }    String compress = getCompression();    if (compress != null) {        writeOut(outputstream, " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\"");      writeOutAttribute(outputstream, compress.toString());      writeOut(outputstream, "\"");    }    if (writeHrefAttribute)        writeOut(outputstream, "/>");  //we just close the data node now    else        writeOut(outputstream, ">");  //end of opening code    Locator currentLocator = parentArray.createLocator();    AxisInterface fastestAxis = (AxisInterface) parentArray.getAxes().get(0);    //stores the NoDataValues for the parentArray,    //used in writing out when NoDataException is caught    String[] NoDataValues;    if (parentArray.hasFieldAxis()) {      NoDataValues = new String[parentArray.getFieldAxis().getLength()];      List fields = parentArray.getFieldAxis().getFields();      Iterator iter = fields.iterator();      int i = 0;      while (iter.hasNext()) {          Field field = (Field) iter.next();          if (field != null && field.getNoDataValue() != null)               NoDataValues[i]=field.getNoDataValue().toString();          i++;      } /*      DataFormat[] dataFormatList = parentArray.getDataFormatList();      for (int i = 0; i < NoDataValues.length; i++) {        DataFormat d =  dataFormatList[i];        if (d != null && d.getNoDataValue() != null)           NoDataValues[i]=d.getNoDataValue().toString();      }*/    }    else {          NoDataValues = new String[1];          NoDataValues[0] = parentArray.getNoDataValue();/*     // what tis this?? If there is no fieldAxis, then no fields,     // and hence, only ONE noDataValue.      DataFormat d = parentArray.getDataFormat();      for (int i = 0; i < NoDataValues.length; i++) {        if (d!=null && d.getNoDataValue() != null)           NoDataValues[i] = d.getNoDataValue().toString();      }*/    }    if (readObj instanceof TaggedXMLDataIOStyle) {      String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags();      int stop = tagOrder.length;      String[] tags = new String[stop];      for (int i = stop-1; i >= 0 ; i--) {        tags[stop-i-1]  = tagOrder[i];      }      int[] axes = getMaxDataIndex();      stop =axes.length;      int[] axisLength = new int[stop];      for (int i = 0; i < stop; i++) {        axisLength[i] =axes[stop - 1 - i];      }      writeTaggedData(dataOutputStream,                      currentLocator,                      indent,                      axisLength,                      tags,                      0,                      fastestAxis,                      NoDataValues);    }  //done dealing with with TaggedXMLDataIOSytle    else {       if (readObj instanceof DelimitedXMLDataIOStyle) {           writeDelimitedData( dataOutputStream, currentLocator,                               (DelimitedXMLDataIOStyle) readObj,                               fastestAxis, NoDataValues,                               writeHrefAttribute ? false : true                              );       }       else {        writeFormattedData(  dataOutputStream,                             currentLocator,                             (FormattedXMLDataIOStyle) readObj,                             fastestAxis,                             NoDataValues,                             writeHrefAttribute ? false : true                           );       }    }    //close the data section appropriately    if (!writeHrefAttribute && niceOutput) {      writeOut(outputstream, Constants.NEW_LINE);      writeOut(outputstream, indent);    }    // If we didnt write Href attribute, then means that data    // were put into document. We need to close the open data    // node appropriately.    if (!writeHrefAttribute)       writeOut(outputstream, "</" + nodeName + ">");    if (niceOutput)      writeOut(outputstream, Constants.NEW_LINE);  }