fix for "negative seek offset" error during extension of heap files.

This would have always happend when a heap file exceeds 2GB.
should fix https://github.com/yacy/yacy_search_server/issues/372
pull/607/head
Michael Peter Christen 1 year ago
parent 9c8fb97985
commit 4a54b24703

@ -117,7 +117,6 @@ public final class Heap extends HeapModifier implements BLOB {
return super.size() + ((this.buffer == null) ? 0 : this.buffer.size());
}
/**
* test if a key is in the heap file. This does not need any IO, because it uses only the ram index
* @param key
@ -147,7 +146,7 @@ public final class Heap extends HeapModifier implements BLOB {
private void add(byte[] key, final byte[] blob) throws IOException {
assert blob.length > 0;
if ((blob == null) || (blob.length == 0)) return;
final int pos = (int) this.file.length();
final long pos = this.file.length();
try {
this.index.put(key, pos);
this.file.seek(pos);

Loading…
Cancel
Save