some additions to kelondroCollection

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2172 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 370c481fa7
commit b30645305b

@ -85,6 +85,32 @@ public class kelondroCollection {
}
}
public long lastRead() {
return lastTimeRead;
}
public long lastWrote() {
return lastTimeWrote;
}
public byte[] get(int index) {
assert (index < chunkcount);
byte[] a = new byte[chunksize];
synchronized (chunkcache) {
System.arraycopy(chunkcache, index * chunksize, a, 0, chunksize);
}
return a;
}
public byte[] get(byte[] key) {
assert (key.length <= chunksize);
synchronized (chunkcache) {
int i = find(key);
if (i >= 0) return get(i);
}
return null;
}
public void add(byte[] a) {
assert (a.length <= chunksize);
synchronized (chunkcache) {

Loading…
Cancel
Save