trackers = new String[trackersList.getLength()]; for ( int trackerIndex = 0; trackerIndex < trackersList.getLength(); trackerIndex++ )
Element tracker = (Element) trackersList.item(trackerIndex); Node child   = tracker.getFirstChild(); if(trackerIndex >= trackers.length)
  public void FromXML( DataInputStream inputStream )  {    DOMParser parser = new DOMParser();    try    {      parser.setFeature("http://xml.org/sax/features/validation", false); // don't validate    }    catch(Exception e)    {      System.out.println("Error: " + e);      System.exit(0);    }        try {      parser.parse(new org.xml.sax.InputSource(inputStream));      Document floodDataDoc = parser.getDocument();      // get all our files and fill out our 'files' array      NodeList fileinfoList = floodDataDoc.getElementsByTagName("FileInfo");      if(fileinfoList.getLength() == 1) { // should only be one fileinfo tag        Element fileinfo = (Element) fileinfoList.item(0);        NodeList fileList = fileinfo.getElementsByTagName("File");        if ( fileList.getLength() > 0)        {          files = new TargetFile[fileList.getLength()];        	          for ( int fileIndex = 0; fileIndex < fileList.getLength(); fileIndex++ )          {            Element file = (Element) fileList.item(fileIndex);            TargetFile targetFile = new TargetFile();                        targetFile.size = Long.parseLong(file.getAttribute("size"));            targetFile.name = file.getAttribute("name");                        NodeList chunkList = file.getElementsByTagName("Chunk");            if ( chunkList.getLength() > 0 )            {              targetFile.chunks = new Chunk[chunkList.getLength()];               for ( int chunkIndex = 0; chunkIndex < chunkList.getLength(); chunkIndex++ )              {                Element chunk = (Element) chunkList.item(chunkIndex);                Chunk tempChunk = new Chunk();                tempChunk.index  = Integer.parseInt(chunk.getAttribute("index"));                tempChunk.weight = Integer.parseInt(chunk.getAttribute("weight"));                tempChunk.size   = Integer.parseInt(chunk.getAttribute("size"));                tempChunk.hash   = chunk.getAttribute("hash");                if(tempChunk.index >= targetFile.chunks.length)                {                  System.out.println("Number of chunks incorrect!");                  System.exit(0);                }                targetFile.chunks[tempChunk.index] = tempChunk;              }            }                        if(fileIndex >= files.length)            {              System.out.println("Number of files incorrect!");              System.exit(0);            	            }            files[fileIndex] = targetFile;          }        }        // get all our trackers        NodeList trackersList = floodDataDoc.getElementsByTagName("Tracker");        if ( trackersList.getLength() > 0)        {          trackers = new String[trackersList.getLength()];          for ( int trackerIndex = 0; trackerIndex < trackersList.getLength(); trackerIndex++ )          {            Element tracker = (Element) trackersList.item(trackerIndex);            Node child   = tracker.getFirstChild();            if(trackerIndex >= trackers.length)            {              System.out.println("Too many trackers!");              System.exit(0);            }            trackers[trackerIndex] = child.getNodeValue().toString();          }     	        }        else        {          System.out.println("No trackers in flood file?");        }        //compute our content hash        ComputeContentHash();    	}      }    } catch (Exception e) {