@ -262,9 +263,15 @@ public class HeapModifier extends HeapReader implements BLOB {
// rewrite the entry
blob=rewriter.rewrite(blob);
intreduction=len-blob.length;
if(reduction==0)return0;// nothing to do
if(reduction==0){
// even if the reduction is zero then it is still be possible that the record has been changed
this.file.seek(pos+4+key.length);
file.write(blob);
return0;
}
// check if the new entry is smaller than the old entry
// the new entry must be smaller than the old entry and must at least be 4 bytes smaller
// because that is the space needed to write a new empty entry record at the end of the gap
if(blob.length>len-4)thrownewIOException("replace of BLOB for key "+newString(key)+" failed (too large): new size = "+blob.length+", old size = "+(len-4));
// replace old content
@ -275,7 +282,7 @@ public class HeapModifier extends HeapReader implements BLOB {