Class IntPtr.Buffer

All Implemented Interfaces:
Addressable
Enclosing class:
IntPtr

public static final class IntPtr.Buffer extends IntPtr
A buffer of IntPtr.
  • Constructor Details

    • Buffer

      public Buffer(MemorySegment segment, long elementCount)
      Creates IntPtr.Buffer with the given segment.
      Parameters:
      segment - the memory segment
      elementCount - the element count
  • Method Details

    • estimateCount

      public long estimateCount()
      Description copied from class: GroupType
      Estimates the element count of this group type buffer.
      Overrides:
      estimateCount in class GroupType
      Returns:
      the estimated element count of the group type buffer
    • asSlice

      public IntPtr asSlice(long index)
      Creates a slice of IntPtr.
      Parameters:
      index - the index of the struct buffer
      Returns:
      the slice of IntPtr
    • asSlice

      public IntPtr.Buffer asSlice(long index, long count)
      Creates a slice of IntPtr.
      Parameters:
      index - the index of the struct buffer
      count - the count
      Returns:
      the slice of IntPtr
    • valueAt

      public int valueAt(long index)
      Returns value at the given index.
      Parameters:
      index - the index of the struct buffer
      Returns:
      value at the given index
    • valueAt

      public IntPtr.Buffer valueAt(long index, int value)
      Sets value with the given value at the given index.
      Parameters:
      index - the index of the struct buffer
      value - the value
      Returns:
      this