this.originalIndexFile = indexFile;
this.indexFile = new RandomAccessFile(indexFile, "rw");
}
public synchronized void addLast(Fixup fixup) {
FileFixup fileFixup = null;
if (fixup instanceof FileFixup) {
fileFixup = (FileFixup) fixup;
if (this.fixedFile != null) {
if (this.fixedFile != fileFixup.getFile()) {
throw new RuntimeException();
}
} else {
// The first fixup file is used if undefined
this.fixedFile = fileFixup.getFile();
}
try {
this.indexFile.seek(this.fixupCount * fixupLength);
this.indexFile.writeLong(fileFixup.getPosition());
this.indexFile.writeLong(fileFixup.getAvailable());
this.fixupCount++;
} catch (IOException e) {
throw new RuntimeException(e);
}
}