|
@@ -47,10 +47,10 @@ class CiphertextReader implements Callable<Void> {
|
|
int bytesRead = -1;
|
|
int bytesRead = -1;
|
|
do {
|
|
do {
|
|
ByteBuffer ciphertext = ByteBuffer.allocate(READ_BUFFER_SIZE);
|
|
ByteBuffer ciphertext = ByteBuffer.allocate(READ_BUFFER_SIZE);
|
|
- file.read(ciphertext);
|
|
|
|
- ciphertext.flip();
|
|
|
|
- bytesRead = ciphertext.remaining();
|
|
|
|
|
|
+ bytesRead = file.read(ciphertext);
|
|
if (bytesRead > 0) {
|
|
if (bytesRead > 0) {
|
|
|
|
+ ciphertext.flip();
|
|
|
|
+ assert bytesRead == ciphertext.remaining();
|
|
decryptor.append(ciphertext);
|
|
decryptor.append(ciphertext);
|
|
}
|
|
}
|
|
} while (bytesRead > 0);
|
|
} while (bytesRead > 0);
|