Package io.trino.spiller
Interface SpillCipher
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AesSpillCipher
public interface SpillCipher extends AutoCloseable
-
-
Method Summary
All Methods Instance Methods Abstract 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 length
-
-
-
Method Detail
-
encryptedMaxLength
int encryptedMaxLength(int inputLength)
Calculates the maximum required buffer size to encrypt input data with the given length
-
encrypt
int encrypt(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 buffer- Returns:
- The length of the encrypted content in the destination buffer
-
decryptedMaxLength
int decryptedMaxLength(int encryptedLength)
Calculates the required buffer size to decrypt data with the given encrypted length
-
decrypt
int decrypt(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 buffer- Returns:
- The length of the decrypted content in destination buffer
-
close
void close()
Destroys the cipher, preventing future use. Implementations should allow this to be called multiple times without failing.- Specified by:
closein interfaceAutoCloseable
-
-