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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Destroys the cipher, preventing future use.
    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
    int
    decryptedMaxLength(int encryptedLength)
    Calculates the required buffer size to decrypt data with the given encrypted length
    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
    int
    encryptedMaxLength(int inputLength)
    Calculates the maximum required buffer size to encrypt input data with the given length
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AesSpillCipher

      public AesSpillCipher()
  • Method Details

    • encryptedMaxLength

      public int encryptedMaxLength(int inputLength)
      Description copied from interface: SpillCipher
      Calculates the maximum required buffer size to encrypt input data with the given length
      Specified by:
      encryptedMaxLength in interface SpillCipher
    • decryptedMaxLength

      public int decryptedMaxLength(int encryptedLength)
      Description copied from interface: SpillCipher
      Calculates the required buffer size to decrypt data with the given encrypted length
      Specified by:
      decryptedMaxLength in interface SpillCipher
    • encrypt

      public int encrypt(byte[] data, int inputOffset, int length, byte[] destination, int destinationOffset)
      Description copied from interface: SpillCipher
      Encrypts the contents of the input buffer into the destination buffer returning the number of bytes written into the destination buffer
      Specified by:
      encrypt in interface SpillCipher
      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: SpillCipher
      Decrypts the contents of the input buffer into the destination buffer, returning the number of bytes written into the destination buffer
      Specified by:
      decrypt in interface SpillCipher
      Returns:
      The length of the decrypted content in destination buffer
    • close

      public void close()
      Description copied from interface: SpillCipher
      Destroys the cipher, preventing future use. Implementations should allow this to be called multiple times without failing.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SpillCipher
    • toString

      public String toString()
      Overrides:
      toString in class Object