Class CMsghdr.Buffer

All Implemented Interfaces:
AutoCloseable, Iterable<CMsghdr>, NativeResource, Pointer
Enclosing class:
CMsghdr

public static class CMsghdr.Buffer extends StructBuffer<CMsghdr,CMsghdr.Buffer> implements NativeResource
An array of CMsghdr structs.
  • Constructor Details

    • Buffer

      public Buffer(ByteBuffer container)
      Creates a new CMsghdr.Buffer instance backed by the specified container.

      Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by CMsghdr.SIZEOF, and its mark will be undefined.

      The created buffer instance holds a strong reference to the container object.

    • Buffer

      public Buffer(long address, int cap)
  • Method Details

    • cmsg_len

      public int cmsg_len()
      Returns:
      the value of the cmsg_len field.
    • cmsg_level

      public int cmsg_level()
      Returns:
      the value of the cmsg_level field.
    • cmsg_type

      public int cmsg_type()
      Returns:
      the value of the cmsg_type field.
    • cmsg_data

      public ByteBuffer cmsg_data()
      Returns:
      a ByteBuffer view of the cmsg_data field.
    • cmsg_data

      public byte cmsg_data(int index)
      Returns:
      the value at the specified index of the cmsg_data field.
    • cmsg_len

      public CMsghdr.Buffer cmsg_len(int value)
      Sets the specified value to the cmsg_len field.
    • cmsg_level

      public CMsghdr.Buffer cmsg_level(int value)
      Sets the specified value to the cmsg_level field.
    • cmsg_type

      public CMsghdr.Buffer cmsg_type(int value)
      Sets the specified value to the cmsg_type field.
    • cmsg_data

      public CMsghdr.Buffer cmsg_data(ByteBuffer value)
      Copies the specified ByteBuffer to the cmsg_data field.
    • cmsg_data

      public CMsghdr.Buffer cmsg_data(int index, byte value)
      Sets the specified value at the specified index of the cmsg_data field.