while (true) {
final ArrayList<Pair<LogFileKey,LogFileValue>> buffer = new ArrayList<Pair<LogFileKey,LogFileValue>>();
try {
long start = input.getPos();
while (input.getPos() - start < bufferSize) {
LogFileKey key = new LogFileKey();
LogFileValue value = new LogFileValue();
key.readFields(decryptingInput);
value.readFields(decryptingInput);
buffer.add(new Pair<LogFileKey,LogFileValue>(key, value));
}
writeBuffer(destPath, buffer, part++);
buffer.clear();