if (nrofDataFormat > 1) if (CurrentDataFormatIndex == (nrofDataFormat - 1))
if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1))
    private void addByteDataToCurrentArray (byte[] data, int amount, String endian, int nrofDataFormat) {        ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getCommands();        int nrofIOCmd = commandList.size();        int bytes_added = 0;Log.errorln("Adding "+amount+" bytes of data to current array");        while (bytes_added < amount) {            FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex);            // readCell            if (currentIOCmd instanceof ReadCellFormattedIOCmd) {               DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex];               int bytes_to_add = currentDataFormat.numOfBytes();Log.errorln("Adding "+bytes_to_add+" bytes of data to current array");//Object objectToAdd = null;               if ( currentDataFormat instanceof IntegerDataFormat) {               } else if (currentDataFormat instanceof FloatDataFormat) {Log.errorln("Got Href Data Float:["+new String(data,bytes_added,bytes_added+bytes_to_add)+ "]["+bytes_added+"]["+bytes_to_add+"]");               } else if (currentDataFormat instanceof BinaryFloatDataFormat) {                  if (bytes_to_add == 4) {                        Float myValue = convert4bytesToFloat(endian, data, bytes_added);Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]");                  } else if (bytes_to_add == 8) {                     Double myValue = convert8bytesToDouble(endian, data, bytes_added);Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]");                  } else {                     Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data.");                  }               } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {                  Integer myValue = convert2bytesToInteger (endian, data, bytes_added);Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]");               } else if (currentDataFormat instanceof StringDataFormat) {// char[] charList = bytesTo8BitChars(data,bytes_added,bytes_added+bytes_to_add);Log.errorln("String byte range is :"+bytes_added+" to "+(bytes_added+bytes_to_add));Log.errorln("Got Href Data String:["+new String(data,bytes_added,(bytes_added+bytes_to_add))+ "]["+bytes_added+"]["+bytes_to_add+"]");               }               // advance our global pointer to the current DataFormat               if (nrofDataFormat > 1)                  if (CurrentDataFormatIndex == (nrofDataFormat - 1))                     CurrentDataFormatIndex = 0;                  else                     CurrentDataFormatIndex++;                bytes_added += bytes_to_add;            } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) {                               Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount();                bytes_added += bytes_to_skip.intValue();            } else if (currentIOCmd instanceof RepeatFormattedIOCmd) {               // shouldnt happen               Log.errorln("Argh getCommands not working right, got repeat command in addByteData!!!");               System.exit(-1);            }            // advance our global pointer to the current IOCmd            if (nrofIOCmd> 1)              if (CurrentIOCmdIndex == (nrofIOCmd - 1))                 CurrentIOCmdIndex = 0;              else                 CurrentIOCmdIndex++;        }    }