Interface FragmentedMemoryInterface

    • Method Detail

      • getNumberOfFragments

        int getNumberOfFragments()
        Returns the number of fragments.
        Returns:
        number of fragments
      • get

        ContiguousMemoryInterface get​(int pFragmentIndex)
        Returns the contiguous memory at a given index.
        Parameters:
        pFragmentIndex - index
        Returns:
        contiguous memory
      • add

        void add​(ContiguousMemoryInterface pContiguousMemory)
        Adds a contiguous memory fragment to this fragmented memory
        Parameters:
        pContiguousMemory - contiguous fragment
      • remove

        void remove​(ContiguousMemoryInterface pContiguousMemory)
        Removes a counties fragment from this fragmented memory.
        Parameters:
        pContiguousMemory - ?
      • add

        OffHeapMemory add​(Buffer pNIOBuffer)
        Adds a NIO buffer to this fragmented memory.
        Parameters:
        pNIOBuffer - NIO buffer
        Returns:
        the actual contiguous memory used internally.
      • makeConsolidatedCopy

        OffHeapMemory makeConsolidatedCopy()
        Returns a consolidated contiguous copy of this fragmented memory - this is done by simply concatenating the contiguous memory regions together in the list order.
        Returns:
        consolidated memory
      • makeConsolidatedCopy

        void makeConsolidatedCopy​(ContiguousMemoryInterface pDestinationMemory)
        Consolidates (copies) the contents of this fragmented memory into a given contiguous buffer.
        Parameters:
        pDestinationMemory - destination memory