in src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java [357:382]
protected int decryptMore() throws IOException {
if (finalDone) {
return EOS;
}
final int n = input.read(inBuffer);
if (n < 0) {
// The stream is end, finalize the cipher stream
decryptFinal();
// Satisfy the read with the remaining
final int remaining = outBuffer.remaining();
if (remaining > 0) {
return remaining;
}
// End of the stream
return EOS;
}
if (n == 0) {
// No data is read, but the stream is not end yet
return 0;
}
decrypt();
return outBuffer.remaining();
}