Interface CleanableDirectBuffer


  • public interface CleanableDirectBuffer
    Encapsulates a direct ByteBuffer and its mechanism for immediate deallocation, if any.
    • Method Detail

      • buffer

        ByteBuffer buffer()
        Get the buffer instance.

        Note: the buffer must not be accessed after the clean() method has been called.

        Returns:
        The ByteBuffer instance.
      • clean

        void clean()
        Deallocate the buffer. This method can only be called once per instance, and all usages of the buffer must have ceased before this method is called, and the buffer must not be accessed again after this method has been called.