Logger.normal(this, "Resuming splitfile download for "+this);
boolean completeViaTruncation = dis.readBoolean();
if(completeViaTruncation) {
fileCompleteViaTruncation = new File(dis.readUTF());
if(!fileCompleteViaTruncation.exists())
throw new ResumeFailedException("Storage file does not exist: "+fileCompleteViaTruncation);
callbackCompleteViaTruncation = (FileGetCompletionCallback) getter;
long rafSize = dis.readLong();
if(fileCompleteViaTruncation.length() != rafSize)
throw new ResumeFailedException("Storage file is not of the correct length");
// FIXME check against finalLength too, maybe we can finish straight away.
this.raf = new PooledFileRandomAccessBuffer(fileCompleteViaTruncation, false, rafSize, null, -1, true);
} else {
this.raf = BucketTools.restoreRAFFrom(dis, context.persistentFG, context.persistentFileTracker, context.getPersistentMasterSecret());
fileCompleteViaTruncation = null;