Interface SDL_RWReadFunction

  • All Superinterfaces:
    com.sun.jna.Callback
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface SDL_RWReadFunction
    extends com.sun.jna.Callback

    Warning: It is necessary to keep a reference to the callback object somewhere in your Java program, otherwise JNA would dispose of the object (GC would clean it) and the callback function would no longer be available for SDL library's C code to call.

    In case you did not keep the reference you would encounter an error like this:

    JNA: callback object has been garbage collected

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.sun.jna.Callback

        com.sun.jna.Callback.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from interface com.sun.jna.Callback

        FORBIDDEN_NAMES, METHOD_NAME
    • Method Detail

      • read

        size_t read​(SDL_RWops context,
                    com.sun.jna.Pointer ptr,
                    size_t itemSize,
                    size_t maxnum)
        Read up to maxnum objects each of size from the data stream to the area pointed at by ptr.
        Returns:
        the number of objects read, or 0 at error or end of file.