added more asserts to BLOBHeap.flushBuffer() to fix the problem described in

http://forum.yacy-websuche.de/viewtopic.php?f=6&t=1679&hilit=&p=13109#p13109

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5666 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2009-03-03 23:24:19 +00:00
parent c545fcb9fa
commit d4b56d5819

View File

@ -170,8 +170,11 @@ public final class BLOBHeap extends BLOBHeapModifier implements BLOB {
index.putl(key, posFile);
b = AbstractRandomAccess.int2array(key.length + blob.length);
assert b.length == 4;
assert posBuffer + 4 < ba.length : "posBuffer = " + posBuffer + ", ba.length = " + ba.length;
System.arraycopy(b, 0, ba, posBuffer, 4);
assert posBuffer + 4 + key.length <= ba.length : "posBuffer = " + posBuffer + ", key.length = " + key.length + ", ba.length = " + ba.length;
System.arraycopy(key, 0, ba, posBuffer + 4, key.length);
assert posBuffer + 4 + key.length + blob.length <= ba.length : "posBuffer = " + posBuffer + ", key.length = " + key.length + ", blob.length = " + blob.length + ", ba.length = " + ba.length;
System.arraycopy(blob, 0, ba, posBuffer + 4 + key.length, blob.length);
posFile += 4 + key.length + blob.length;
posBuffer += 4 + key.length + blob.length;