Class FT_Stream

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class FT_Stream extends Struct<FT_Stream> implements NativeResource

 struct FT_StreamRec {
     unsigned char * base;
     unsigned long size;
     unsigned long pos;
     {@link FT_StreamDesc FT_StreamDesc} descriptor;
     {@link FT_StreamDesc FT_StreamDesc} pathname;
     {@link FT_Stream_IoFuncI FT_Stream_IoFunc} read;
     {@link FT_Stream_CloseFuncI FT_Stream_CloseFunc} close;
     FT_Memory memory;
     unsigned char * cursor;
     unsigned char * limit;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int BASE
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
    • POS

      public static final int POS
      The struct member offsets.
    • DESCRIPTOR

      public static final int DESCRIPTOR
      The struct member offsets.
    • PATHNAME

      public static final int PATHNAME
      The struct member offsets.
    • READ

      public static final int READ
      The struct member offsets.
    • CLOSE

      public static final int CLOSE
      The struct member offsets.
    • MEMORY

      public static final int MEMORY
      The struct member offsets.
    • CURSOR

      public static final int CURSOR
      The struct member offsets.
    • LIMIT

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

    • FT_Stream

      public FT_Stream(ByteBuffer container)
      Creates a FT_Stream 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<FT_Stream>
    • base

      public @Nullable ByteBuffer base()
      Returns:
      a ByteBuffer view of the data pointed to by the base field.
    • size

      public long size()
      Returns:
      the value of the size field.
    • pos

      public long pos()
      Returns:
      the value of the pos field.
    • descriptor

      public FT_StreamDesc descriptor()
      Returns:
      a FT_StreamDesc view of the descriptor field.
    • pathname

      public FT_StreamDesc pathname()
      Returns:
      a FT_StreamDesc view of the pathname field.
    • read

      public @Nullable FT_Stream_IoFunc read()
      Returns:
      the value of the read field.
    • close$

      public @Nullable FT_Stream_CloseFunc close$()
      Returns:
      the value of the close field.
    • base

      public FT_Stream base(@Nullable ByteBuffer value)
      Sets the address of the specified ByteBuffer to the base field.
    • size

      public FT_Stream size(long value)
      Sets the specified value to the size field.
    • pos

      public FT_Stream pos(long value)
      Sets the specified value to the pos field.
    • descriptor

      public FT_Stream descriptor(FT_StreamDesc value)
      Copies the specified FT_StreamDesc to the descriptor field.
    • descriptor

      public FT_Stream descriptor(Consumer<FT_StreamDesc> consumer)
      Passes the descriptor field to the specified Consumer.
    • pathname

      public FT_Stream pathname(FT_StreamDesc value)
      Copies the specified FT_StreamDesc to the pathname field.
    • pathname

      public FT_Stream pathname(Consumer<FT_StreamDesc> consumer)
      Passes the pathname field to the specified Consumer.
    • read

      public FT_Stream read(@Nullable FT_Stream_IoFuncI value)
      Sets the specified value to the read field.
    • close$

      public FT_Stream close$(@Nullable FT_Stream_CloseFuncI value)
      Sets the specified value to the close field.
    • set

      public FT_Stream set(@Nullable ByteBuffer base, long size, long pos, FT_StreamDesc descriptor, FT_StreamDesc pathname, @Nullable FT_Stream_IoFuncI read, @Nullable FT_Stream_CloseFuncI close$)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static FT_Stream.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new FT_Stream.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
    • nbase

      public static @Nullable ByteBuffer nbase(long struct)
      Unsafe version of base.
    • nsize

      public static long nsize(long struct)
      Unsafe version of size().
    • npos

      public static long npos(long struct)
      Unsafe version of pos().
    • ndescriptor

      public static FT_StreamDesc ndescriptor(long struct)
      Unsafe version of descriptor().
    • npathname

      public static FT_StreamDesc npathname(long struct)
      Unsafe version of pathname().
    • nread

      public static @Nullable FT_Stream_IoFunc nread(long struct)
      Unsafe version of read().
    • nclose$

      public static @Nullable FT_Stream_CloseFunc nclose$(long struct)
      Unsafe version of close$().
    • nmemory

      public static @Nullable FT_Memory nmemory(long struct)
    • ncursor

      public static @Nullable ByteBuffer ncursor(long struct, int capacity)
    • nlimit$

      public static @Nullable ByteBuffer nlimit$(long struct, int capacity)
    • nbase

      public static void nbase(long struct, @Nullable ByteBuffer value)
      Unsafe version of base.
    • nsize

      public static void nsize(long struct, long value)
      Sets the specified value to the size field of the specified struct.
    • npos

      public static void npos(long struct, long value)
      Unsafe version of pos.
    • ndescriptor

      public static void ndescriptor(long struct, FT_StreamDesc value)
      Unsafe version of descriptor.
    • npathname

      public static void npathname(long struct, FT_StreamDesc value)
      Unsafe version of pathname.
    • nread

      public static void nread(long struct, @Nullable FT_Stream_IoFuncI value)
      Unsafe version of read.
    • nclose$

      public static void nclose$(long struct, @Nullable FT_Stream_CloseFuncI value)
      Unsafe version of close$.
    • nmemory

      public static void nmemory(long struct, @Nullable FT_Memory value)
    • ncursor

      public static void ncursor(long struct, @Nullable ByteBuffer value)
    • nlimit$

      public static void nlimit$(long struct, @Nullable ByteBuffer value)