LockableRandomAccessBuffer raf = factory.makeRAF(paddedSize);
if(secret != null) {
if(realSize != paddedSize)
raf = new PaddedRandomAccessBuffer(raf, realSize);
try {
raf = new EncryptedRandomAccessBuffer(TempBucketFactory.CRYPT_TYPE, raf, secret, true);
} catch (GeneralSecurityException e) {
Logger.error(this, "Cannot create encrypted tempfile: "+e, e);
}
}
return raf;