Package io.trino.spiller
Class AesSpillCipher
- java.lang.Object
-
- io.trino.spiller.AesSpillCipher
-
- All Implemented Interfaces:
SpillCipher,AutoCloseable
public final class AesSpillCipher extends Object implements SpillCipher
-
-
Constructor Summary
Constructors Constructor Description AesSpillCipher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Destroys the cipher, preventing future use.intdecrypt(byte[] encryptedData, int inputOffset, int length, byte[] destination, int destinationOffset)Decrypts the contents of the input buffer into the destination buffer, returning the number of bytes written into the destination bufferintdecryptedMaxLength(int encryptedLength)Calculates the required buffer size to decrypt data with the given encrypted lengthintencrypt(byte[] data, int inputOffset, int length, byte[] destination, int destinationOffset)Encrypts the contents of the input buffer into the destination buffer returning the number of bytes written into the destination bufferintencryptedMaxLength(int inputLength)Calculates the maximum required buffer size to encrypt input data with the given lengthStringtoString()
-
-
-
Method Detail
-
encryptedMaxLength
public int encryptedMaxLength(int inputLength)
Description copied from interface:SpillCipherCalculates the maximum required buffer size to encrypt input data with the given length- Specified by:
encryptedMaxLengthin interfaceSpillCipher
-
decryptedMaxLength
public int decryptedMaxLength(int encryptedLength)
Description copied from interface:SpillCipherCalculates the required buffer size to decrypt data with the given encrypted length- Specified by:
decryptedMaxLengthin interfaceSpillCipher
-
encrypt
public int encrypt(byte[] data, int inputOffset, int length, byte[] destination, int destinationOffset)Description copied from interface:SpillCipherEncrypts the contents of the input buffer into the destination buffer returning the number of bytes written into the destination buffer- Specified by:
encryptin interfaceSpillCipher- Returns:
- The length of the encrypted content in the destination buffer
-
decrypt
public int decrypt(byte[] encryptedData, int inputOffset, int length, byte[] destination, int destinationOffset)Description copied from interface:SpillCipherDecrypts the contents of the input buffer into the destination buffer, returning the number of bytes written into the destination buffer- Specified by:
decryptin interfaceSpillCipher- Returns:
- The length of the decrypted content in destination buffer
-
close
public void close()
Description copied from interface:SpillCipherDestroys the cipher, preventing future use. Implementations should allow this to be called multiple times without failing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSpillCipher
-
-