Interface NettyDaveFactory

All Superinterfaces:
DaveFactory

public interface NettyDaveFactory extends DaveFactory
Factory for creating Netty-enabled decryptors and encryptors.

Creates instances of NettyDecryptor and NettyEncryptor that support direct operations on Netty ByteBuf for improved performance and reduced allocations.

Requirements: This requires io.netty:netty-buffer to be available on the classpath. Loading any classes from this package without Netty will result in ClassNotFoundException.

See Also:
  • Method Details

    • fromDecryptor

      NettyDecryptor fromDecryptor(Decryptor decryptor)
      Converts a Decryptor into a Netty-enabled NettyDecryptor.

      If the provided decryptor already supports Netty (implements NettyDecryptor), it is returned unchanged. Otherwise, its internal state is transferred to a new Netty-enabled decryptor, and the original is closed.

      Note: After calling this method, the original decryptor is closed and should not be used.

      Parameters:
      decryptor - A decryptor instance created by this factory.
      Returns:
      A Netty-enabled decryptor.
      Throws:
      IllegalArgumentException - if the decryptor was created by an incompatible factory.
    • fromEncryptor

      NettyEncryptor fromEncryptor(Encryptor encryptor)
      Converts a Encryptor into a Netty-enabled NettyEncryptor.

      If the provided encryptor already supports Netty (implements NettyEncryptor), it is returned unchanged. Otherwise, its internal state is transferred to a new Netty-enabled encryptor, and the original is closed.

      Note: After calling this method, the original encryptor is closed and should not be used.

      Parameters:
      encryptor - An encryptor instance created by this factory.
      Returns:
      A Netty-enabled encryptor.
      Throws:
      IllegalArgumentException - if the encryptor was created by an incompatible factory.