mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Optimised use of buffers when decrypting to avoid unnecessary array copying properly.
This commit is contained in:
parent
3cc6344c8b
commit
adfa3c1b10
@ -157,7 +157,7 @@ public class DecryptingPartInputStream extends FileInputStream {
|
|||||||
//data retrieved using cipher.update doesn't always match cipher.getOutputSize (but should never be larger)
|
//data retrieved using cipher.update doesn't always match cipher.getOutputSize (but should never be larger)
|
||||||
int outputLen = cipher.getOutputSize(read);
|
int outputLen = cipher.getOutputSize(read);
|
||||||
|
|
||||||
if (outputLen < length) {
|
if (outputLen <= length) {
|
||||||
readLength += cipher.update(internalBuffer, 0, read, buffer, offset);
|
readLength += cipher.update(internalBuffer, 0, read, buffer, offset);
|
||||||
return readLength;
|
return readLength;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user