title: JNA getting back a byte array
body: <p>I have a library developed in C that successfully decompresses an LZMA encoded file. The signature for the file is a pointer to the data, the compressed, decompressed, and an 'out' field for the error code. The return value is a pointer to the array (or null if it fails).</p>
  
  <p>The function in C looks similar to this:</p>
  
  <pre><code>char* decompressLZMA(const char *lzmaData, int compressedSize, int uncompressedSize, t_status_codes *statusCode);
  </code></pre>
  
  <p>I've tried using pointers and memory from other examples but they are not working.</p>
  
  <p>How do I properly pass a byte array and pointer in to get data back?</p>
  
  <p>This is my interface:</p>
  
  <pre><code>public interface LZMALibrary extends Library {
      Memory lzma_uncompress(Memory lzma_data, int compressed_size, int uncompressed_size, Pointer status_code);
  }
  </code></pre>