Class InvocationBuffer

java.lang.Object
com.kenai.jffi.InvocationBuffer
Direct Known Subclasses:
HeapInvocationBuffer

public abstract class InvocationBuffer extends Object
A parameter buffer used when invoking a function
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    putAddress(long value)
    Adds a native address parameter.
    abstract void
    putArray(byte[] value, int offset, int length, int flags)
    Adds a java byte array as a pointer parameter.
    abstract void
    putArray(double[] value, int offset, int length, int flags)
    Adds a java double array as a pointer parameter.
    abstract void
    putArray(float[] value, int offset, int length, int flags)
    Adds a java float array as a pointer parameter.
    abstract void
    putArray(int[] value, int offset, int length, int flags)
    Adds a java int array as a pointer parameter.
    abstract void
    putArray(long[] value, int offset, int length, int flags)
    Adds a java long array as a pointer parameter.
    abstract void
    putArray(short[] value, int offset, int length, int flags)
    Adds a java short array as a pointer parameter.
    abstract void
    putByte(int value)
    Adds an 8 bit integer parameter.
    abstract void
    putDirectBuffer(Buffer buffer, int offset, int length)
    Adds a java direct buffer as a pointer parameter.
    abstract void
    putDouble(double value)
    Adds a 64 bit floating point parameter.
    abstract void
    putFloat(float value)
    Adds a 32 bit floating point parameter.
    abstract void
    putInt(int value)
    Adds a 32 bit integer parameter.
    abstract void
    putLong(long value)
    Adds a 64 bit integer parameter.
    abstract void
    putShort(int value)
    Adds a 16 bit integer parameter.
    abstract void
    putStruct(byte[] struct, int offset)
    Adds a struct or union as a parameter.
    abstract void
    putStruct(long struct)
    Adds a struct or union as a parameter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InvocationBuffer

      public InvocationBuffer()
  • Method Details

    • putByte

      public abstract void putByte(int value)
      Adds an 8 bit integer parameter.
      Parameters:
      value - An 8 bit integer value to use as the parameter.
    • putShort

      public abstract void putShort(int value)
      Adds a 16 bit integer parameter.
      Parameters:
      value - A 16 bit integer value to use as the parameter.
    • putInt

      public abstract void putInt(int value)
      Adds a 32 bit integer parameter.
      Parameters:
      value - A 32 bit integer value to use as the parameter.
    • putLong

      public abstract void putLong(long value)
      Adds a 64 bit integer parameter.
      Parameters:
      value - A 64 bit integer value to use as the parameter.
    • putFloat

      public abstract void putFloat(float value)
      Adds a 32 bit floating point parameter.
      Parameters:
      value - A 32 bit floating point value to use as the parameter.
    • putDouble

      public abstract void putDouble(double value)
      Adds a 64 bit floating point parameter.
      Parameters:
      value - A 64 bit floating point value to use as the parameter.
    • putAddress

      public abstract void putAddress(long value)
      Adds a native address parameter.
      Parameters:
      value - A native address value to use as the parameter.
    • putArray

      public abstract void putArray(byte[] value, int offset, int length, int flags)
      Adds a java byte array as a pointer parameter.
      Parameters:
      value - The java array to use as the pointer parameter.
      offset - The offset from the start of the array.
      length - The length of the array to use.
      flags - The flags to use (IN, OUT)
    • putArray

      public abstract void putArray(short[] value, int offset, int length, int flags)
      Adds a java short array as a pointer parameter.
      Parameters:
      value - The java array to use as the pointer parameter.
      offset - The offset from the start of the array.
      length - The length of the array to use.
      flags - The flags to use (IN, OUT)
    • putArray

      public abstract void putArray(int[] value, int offset, int length, int flags)
      Adds a java int array as a pointer parameter.
      Parameters:
      value - The java array to use as the pointer parameter.
      offset - The offset from the start of the array.
      length - The length of the array to use.
      flags - The flags to use (IN, OUT)
    • putArray

      public abstract void putArray(long[] value, int offset, int length, int flags)
      Adds a java long array as a pointer parameter.
      Parameters:
      value - The java array to use as the pointer parameter.
      offset - The offset from the start of the array.
      length - The length of the array to use.
      flags - The flags to use (IN, OUT)
    • putArray

      public abstract void putArray(float[] value, int offset, int length, int flags)
      Adds a java float array as a pointer parameter.
      Parameters:
      value - The java array to use as the pointer parameter.
      offset - The offset from the start of the array.
      length - The length of the array to use.
      flags - The flags to use (IN, OUT)
    • putArray

      public abstract void putArray(double[] value, int offset, int length, int flags)
      Adds a java double array as a pointer parameter.
      Parameters:
      value - The java array to use as the pointer parameter.
      offset - The offset from the start of the array.
      length - The length of the array to use.
      flags - The flags to use (IN, OUT)
    • putDirectBuffer

      public abstract void putDirectBuffer(Buffer buffer, int offset, int length)
      Adds a java direct buffer as a pointer parameter.
      Parameters:
      buffer - The buffer to use as a pointer argument.
      offset - An offset to add to the buffer native address.
      length - The length of the buffer to use.
    • putStruct

      public abstract void putStruct(byte[] struct, int offset)
      Adds a struct or union as a parameter. This passes the struct or union by value, not by reference.
      Parameters:
      struct - A java byte array with the struct contents.
      offset - The offset from the start of the array.
    • putStruct

      public abstract void putStruct(long struct)
      Adds a struct or union as a parameter. This passes the struct or union by value, not by reference.
      Parameters:
      struct - The native address to use as the struct contents.