-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Description
So I am trying to use this for android and it works but the performance is terrible. It takes several seconds to decrypt an asset I have.
For instance, I have images as low as 50KB to 150KB so nothing too large. But whenever I try to decrypt them, it takes several seconds for them to process. I use this for iOS and it's nearly instantaneous. Would anyone have any suggestions? The function I am using for this process is below...
public byte[] decryptInputStream(InputStream in){
if(in == null)
return null;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int i = Integer.MAX_VALUE;
try{
while((i = in.read(buffer, 0, buffer.length)) > 0)
outputStream.write(buffer, 0, i);
}
catch(Exception e){
}
try {
byte[] decrpytedStream = decryptor.decryptData(outputStream.toByteArray(), KEY.toCharArray());
return decrpytedStream;
}
catch(CryptorException e){
Log.e("AES Cryptor", "Input Stream Decryption Error");
}
return null;
}