improved smoothing, stricter IO impl during encryption

This commit is contained in:
Sebastian Stenzel
2015-10-28 17:55:28 +01:00
parent 5fefa3c6d4
commit 55d1ffe703
2 changed files with 18 additions and 6 deletions
@@ -109,6 +109,17 @@ public class LengthObfuscatingInputStream extends FilterInputStream {
throw new IOException("Skip not supported");
}
@Override
public int available() throws IOException {
if (paddingLength == -1) {
// EOF not yet reached; delegate original stream to answer this rather complicated question:
return in.available();
} else {
// EOF already reached, read from remaining padding:
return paddingLength - paddingBytesRead;
}
}
@Override
public boolean markSupported() {
return false;