title: Exposing void pointers in a generated interface
body: <p>I used SWIG to generate a wrapper for the <a href="https://developer.spotify.com/technologies/libspotify/" rel="nofollow">Spotify library</a> in Java.
  The header file contains</p>
  
  <pre><code>typedef struct sp_session_config {
     ...
    const void *application_key;           ///&lt; Your application key
    ...
  </code></pre>
  
  <p>that should allow me to set in Java the application key:</p>
  
  <pre><code>sp_session_config cfg = new sp_session_config();
  cfg.setApplication_key(appkey);
  </code></pre>
  
  <p>The key in C is declared like this</p>
  
  <pre><code>const uint8_t g_appkey[] = {0x01, 0xB4, 0xF9, 0x33, .... }
  </code></pre>
  
  <p>The problem is that I don't know how to create the key in Java. The type of appkey must be <code>SWIGTYPE_p_void</code>.</p>
  
  <p>I tried to add in the .i file:</p>
  
  <pre><code>%include "carrays.i"
  %array_functions(uint8_t, uint8Array);
  </code></pre>
  
  <p>to be able to create C arrays in Java with these functions:</p>
  
  <pre><code>new_uint8Array
  uint8Array_setitem
  </code></pre>
  
  <p>without success.</p>
  
  <p>How can I resolve my problem? A small simple example would be welcome.</p>