|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||||
com.jniwrapper package contains classes that allow calling native functions from Java(TM) code.
See:
Description
| Interface Summary | |
| ArrayParameter | Common interface for all types representing arrays |
| DataBuffer | Basic interface to any memory location where JNIWrapper types can store their data. |
| FloatParameter | Common interface for all floating-point types. |
| IntegerParameter | Common interface for all integer types. |
| IOPerformer | Parameter I/O visitor interface. |
| LibraryLoader | Basic interface for classes that can find and load native library. |
| MemoryBuffer | Data source associated with an allocated native memory block. |
| StringParameter | |
| Class Summary | |
| AbstractFloat | Base class for all floating point types. |
| AnsiString | Represents a zero-terminated string of 8-bit (ANSI) character
declared in C as (char *). |
| ArithmeticalPointer | Pointer to a place within an allocated structure that handles reading and writing of offset pointer values. |
| Bool | Represents bool (boolean) value and type. |
| Callback | Callback is the superclass for all classes representing callback functions. |
| Char | Represents char value and type. |
| ComplexArray | Represents an array of objects. |
| Const | Represents a read-only parameter. |
| DataBufferFactory | Abstract base for factory classes that produce instances of
appropriate DataBuffer implementation. |
| DefaultLibraryLoader | Default implementation for LibraryLoader that realizes Singleton pattern. |
| DoubleFloat | Represents double float value and type. |
| Enumeration | |
| ExternalArrayPointer | A pointer to an array returned from the native code. |
| Function | The Function class allows to call specified function
from a native code library. |
| Int | C-like int value. |
| Int16 | Represents 16-bit integer value and type. |
| Int32 | Represents 32-bit integer value and type. |
| Int64 | Represents 64-bit integer value and type. |
| Int8 | Represents 8-bit integer (byte) value and type. |
| Library | This class provides operations with a native code library. |
| LongDouble | Represents long double value and type. |
| LongInt | C-like long value. |
| NullBuffer | |
| OutOnly | Represents parameter that is only written by a native function. |
| Parameter | Common parent class for all types of function parameters. |
| PlatformContext | Provides an information on platform dependent type sizes etc. |
| Pointer | This class represents a pointer to object in terms of C language. |
| Pointer.Const | Represents a pointer to constant object. |
| Pointer.OutOnly | Represents a pointer to object with undefined initial value. |
| Pointer.Void | Represents a void *. |
| PrimitiveArray | Represents an array of primitive types such as array of bytes or array of integer values. |
| ResizingPointer | A pointer to an array that can be resized (reallocated) on the native side. |
| ShortInt | C-like short value. |
| SingleFloat | Represents float value and type. |
| Structure | The class represents structures in tems of C language. |
| UInt | C-like unsigned int value. |
| UInt16 | Represents 16-bit unsigned integer value and type. |
| UInt32 | Represents 32-bit unsigned integer value and type. |
| UInt8 | Represents 8-bit unsigned integer value and type. |
| ULongInt | C-like unsigned long value. |
| Union | Represents a C union type. |
| Unused | Represents parameter which is not accessed in native function. |
| UShortInt | C-like unsigned short value. |
| WideChar | Represents unicode character (wchar_t) |
| WideString | Represents Unicode string (wchar_t *) value and type. |
| ZeroTerminatedString | Base class for all types of zero-terminated strings. |
| Exception Summary | |
| FunctionExecutionException | This exception is thrown if an error occurs during a native function call. |
| LibraryNotFoundException | This exception is thrown when a native library cannot be loaded. |
| MemoryAccessViolationException | This exception is thrown when a native library code attempts to reference an invalid memory location. |
| NoSuchFunctionException | Indicates that requested native function was not found in the specified library. |
The com.jniwrapper package contains classes that allow calling native functions from Java(TM) code.
Calling native functions is quite simple if you follow these steps:
DefaultLibraryLoader contains all your PATH entries and
gives you ability to add your own:
DefaultLibraryLoader.getInstance().addPath(new File("path/to/my/code"));
As the name suggests this class is used by default to load native libraries.
LongInt retVal = new LongInt(0);
WideString str = new WideString(256);
UInt32 len = new UInt32(256);
Library kernel = new Library("kernel32");
kernel.getFunction("GetCurrentDirectoryW", null).invoke(retVal, len, new Pointer.OutOnly(str));
System.out.println("Current working directory is: " + str.getValue());
|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||||