Class DATA_BLOB

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class DATA_BLOB extends Struct<DATA_BLOB> implements NativeResource

 struct DATA_BLOB {
     DWORD cbData;
     BYTE * pbData;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • CBDATA

      public static final int CBDATA
      The struct member offsets.
    • PBDATA

      public static final int PBDATA
      The struct member offsets.
  • Constructor Details

    • DATA_BLOB

      public DATA_BLOB(ByteBuffer container)
      Creates a DATA_BLOB instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

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

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<DATA_BLOB>
    • cbData

      public int cbData()
      Returns:
      the value of the cbData field.
    • pbData

      public ByteBuffer pbData()
      Returns:
      a ByteBuffer view of the data pointed to by the pbData field.
    • pbData

      public DATA_BLOB pbData(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the pbData field.
    • set

      public DATA_BLOB set(DATA_BLOB src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static DATA_BLOB malloc()
      Returns a new DATA_BLOB instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static DATA_BLOB calloc()
      Returns a new DATA_BLOB instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static DATA_BLOB create()
      Returns a new DATA_BLOB instance allocated with BufferUtils.
    • create

      public static DATA_BLOB create(long address)
      Returns a new DATA_BLOB instance for the specified memory address.
    • createSafe

      public static @Nullable DATA_BLOB createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static DATA_BLOB.Buffer malloc(int capacity)
      Returns a new DATA_BLOB.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static DATA_BLOB.Buffer calloc(int capacity)
      Returns a new DATA_BLOB.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static DATA_BLOB.Buffer create(int capacity)
      Returns a new DATA_BLOB.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static DATA_BLOB.Buffer create(long address, int capacity)
      Create a DATA_BLOB.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable DATA_BLOB.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static DATA_BLOB malloc(MemoryStack stack)
      Returns a new DATA_BLOB instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static DATA_BLOB calloc(MemoryStack stack)
      Returns a new DATA_BLOB instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static DATA_BLOB.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new DATA_BLOB.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static DATA_BLOB.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new DATA_BLOB.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ncbData

      public static int ncbData(long struct)
      Unsafe version of cbData().
    • npbData

      public static ByteBuffer npbData(long struct)
      Unsafe version of pbData.
    • ncbData

      public static void ncbData(long struct, int value)
      Sets the specified value to the cbData field of the specified struct.
    • npbData

      public static void npbData(long struct, ByteBuffer value)
      Unsafe version of pbData.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate