Class DirectCleaner.CleanableDirectBufferImpl

java.lang.Object
io.netty.util.internal.DirectCleaner.CleanableDirectBufferImpl
All Implemented Interfaces:
CleanableDirectBuffer
Enclosing class:
DirectCleaner

private static final class DirectCleaner.CleanableDirectBufferImpl extends java.lang.Object implements CleanableDirectBuffer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final java.nio.ByteBuffer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    CleanableDirectBufferImpl(java.nio.ByteBuffer buffer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    java.nio.ByteBuffer
    Get the buffer instance.
    void
    Deallocate the buffer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface CleanableDirectBuffer

    hasMemoryAddress, memoryAddress
  • Field Details

    • buffer

      private final java.nio.ByteBuffer buffer
  • Constructor Details

    • CleanableDirectBufferImpl

      CleanableDirectBufferImpl(int capacity)
    • CleanableDirectBufferImpl

      CleanableDirectBufferImpl(java.nio.ByteBuffer buffer)
  • Method Details

    • buffer

      public java.nio.ByteBuffer buffer()
      Description copied from interface: CleanableDirectBuffer
      Get the buffer instance.

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

      Specified by:
      buffer in interface CleanableDirectBuffer
      Returns:
      The ByteBuffer instance.
    • clean

      public void clean()
      Description copied from interface: CleanableDirectBuffer
      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.
      Specified by:
      clean in interface CleanableDirectBuffer