public void updateByAppendingData(TaskObserver taskObserver, RandomAccessFile randomAccessFile, LodResource resourceToImport) throws IOException, InterruptedException
    {
        taskObserver.taskProgress(resourceToImport.getName(), 0);

        LodEntry lodEntryToUpdate = null;
        float counter = 0;
        Iterator lodEntryByDataOffsetIterator = getLodEntries().values().iterator();
        while (lodEntryByDataOffsetIterator.hasNext())
        {
            if (Thread.currentThread().isInterrupted())
                throw new InterruptedException("append thread was interrupted.");

            LodEntry lodEntry = (LodEntry)lodEntryByDataOffsetIterator.next();

            if (resourceToImport.getName().equals(lodEntry.getEntryName()))
            {
                lodEntryToUpdate = lodEntry;
                break;
            }
            else if (resourceToImport.getName().equals(lodEntry.getFileName()))
            {
                lodEntryToUpdate = lodEntry;
                break;
            }
        }
        
        taskObserver.taskProgress(resourceToImport.getName(), 0.10f);

        if (null == lodEntryToUpdate)
        {
            throw new RuntimeException("Unable to find lod entry for '" + resourceToImport.getName() + "'.");
        }

        long oldFileSize = lodEntryToUpdate.getLodFile().getFile().length();
        RandomAccessFileOutputStream randomAccessFileOutputStream = new RandomAccessFileOutputStream(randomAccessFile);

        // append data content
        randomAccessFileOutputStream.getFile().seek(oldFileSize);
        long newFileSize = lodEntryToUpdate.updateData(resourceToImport, randomAccessFileOutputStream, oldFileSize);

        taskObserver.taskProgress(resourceToImport.getName(), 0.90f);
        if (Thread.currentThread().isInterrupted())
            throw new InterruptedException("append thread was interrupted.");

        // update entry content
        long entryOffset = lodEntryToUpdate.getEntryOffset();
        randomAccessFileOutputStream.getFile().seek(entryOffset);
        long newFileSize2 = lodEntryToUpdate.updateEntry(resourceToImport, randomAccessFileOutputStream, this.getFileHeader().length, entryOffset, oldFileSize);

        if (newFileSize != newFileSize2)
            throw new RuntimeException("Data size was " + newFileSize + ", but entry computed size as " + newFileSize2);

        if (Thread.currentThread().isInterrupted())
            throw new InterruptedException("append thread was interrupted.");

        taskObserver.taskProgress(resourceToImport.getName(), 0.99f);
        // update file header
        long fileSizeMinusFileHeaderSize = newFileSize - this.getFileHeader().length;
        if (-1 != getFileSizeMinusFileHeaderSizeOffset())
        {
            byte newFileSizeMinusFileHeaderSize[] = new byte[4];
            ByteConversions.setIntegerInByteArrayAtPosition(fileSizeMinusFileHeaderSize, newFileSizeMinusFileHeaderSize, 0);
            randomAccessFile.seek(getFileSizeMinusFileHeaderSizeOffset());
            randomAccessFile.write(newFileSizeMinusFileHeaderSize);
        }
    }