Skip to content

Commit

Permalink
Note direct mapping and link
Browse files Browse the repository at this point in the history
  • Loading branch information
twall committed Sep 25, 2012
1 parent e42b2ca commit a814936
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion www/GettingStarted.md
Expand Up @@ -91,7 +91,10 @@ You can now invoke methods on the library instance just like any other Java clas

System.out.println("Today's integer value is " + time.wDay);

Alternatively, you may declare a class to hold your native methods, declare any number of methods with the `native` qualifier, and invoke `Native.register(String)` in the class static initializer with your library's name. See [JNA Direct Mapping](DirectMapping.md) for an example.
Optimized Direct Mapping
------------------------

JNA provides an additional method of mapping native methods, should you need extra performance. You may declare a class to hold your native methods, declare any number of methods with the `native` qualifier, and invoke `Native.register(String)` in the class static initializer with your library's name. See [JNA Direct Mapping](DirectMapping.md) for an example, as well as any of the [`DirectXXXTest`](https://github.com/twall/jna/tree/master/test/com/sun/jna) unit tests.

If the C header files for your library are available, you can auto-generate a library mapping by using Olivier Chafik's excellent [JNAerator](http://jnaerator.googlecode.com/) utility. This is especially useful if your library uses long or complicated structures where translating by hand can be error-prone.

0 comments on commit a814936

Please sign in to comment.