int nrofDataFormat = DataFormatList.length;
    private void loadHrefDataIntoCurrentArray () {        Href hrefObj = CurrentArray.getDataCube().getHref();       // well, we should be doing something with base here,        // but arent because it isnt captured by this API. feh.       // $file = $href->getBase() if $href->getBase();       if (hrefObj.getSysId() != null) {          try {             InputStream in = null;             try {               InputSource inputSource = resolveEntity(hrefObj.getPubId(), hrefObj.getSysId());               in = inputSource.getByteStream();             } catch (SAXException e) {                Log.printStackTrace(e);             } catch (NullPointerException e) {                // in this case the InputSource object is null to request that                 // the parser open a regular URI connection to the system identifier.                // In our case, the sysId IS the filename.                File f = new File(hrefObj.getSysId());                in = (InputStream) new FileInputStream(new File(hrefObj.getSysId()));             }             // ok, got a bytestream, now read the info             // Need to use a buffered reader here!!!             if (in != null) {                // probably could treat endian/nrofDataFormat as a globals too, since thats                // how we treat the rest of the array parameters                int nrofDataFormat = DataFormatList.length;                String endian = CurrentArray.getXMLDataIOStyle().getEndian();                byte[] data = new byte[INPUTREADSIZE];                int bytes_read = 0;                while ( true ) {                  int readAmount = in.read(data, bytes_read, INPUTREADSIZE-bytes_read);                  if ( readAmount == -1 )                  {                      // pour out remaining buffer into the current array                     addByteDataToCurrentArray(data, bytes_read, endian, nrofDataFormat);Log.errorln("Dumping buffer after reading in "+bytes_read+" bytes");                      break; // EOF reached                  }                  bytes_read += readAmount;                  // we exceeded the size of the buffer, dump to list                  if ( bytes_read == INPUTREADSIZE)                   { Log.errorln("Dumping buffer after reading in "+bytes_read+" bytes");                     // pour out buffer into array                     addByteDataToCurrentArray(data, bytes_read, endian, nrofDataFormat);                     bytes_read = 0;                  }                }             }          } catch (java.io.IOException e) {             Log.printStackTrace(e);          }       } else {          Log.warnln("Can't read Href data, undefined sysId!");       }    }