larger buffer size for iterateData, avoif native available calls

This commit is contained in:
Maxim.Mossienko
2013-08-19 11:59:17 +02:00
parent 9409ec6f4c
commit 85e03b4fe6
2 changed files with 10 additions and 1 deletions
@@ -72,6 +72,10 @@ public class LimitedInputStream extends FilterInputStream {
return Math.min(super.available(), myReadLimit - myBytesRead);
}
protected int remainingLimit() {
return myReadLimit - myBytesRead;
}
public synchronized void mark(final int readLimit) {
throw new UnsupportedOperationException();
}
@@ -509,7 +509,12 @@ abstract class PersistentEnumeratorBase<Data> implements Forceable, Closeable {
myKeyStorage.force();
DataInputStream keysStream = new DataInputStream(new BufferedInputStream(new LimitedInputStream(new FileInputStream(keystreamFile()),
myKeyStoreFileLength)));
myKeyStoreFileLength) {
@Override
public int available() throws IOException {
return remainingLimit();
}
}, 32768));
try {
try {
while (true) {