title: Invalid Memory Access when calling Delphi method via JNA
body: <p>I am attempting to call the following Delphi method:</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/dDXdW.png" alt=""></p>
  </blockquote>
  
  <p>However, I get this exception:</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/IUouo.png" alt=""></p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
      //解决中文乱码a
      System.setProperty("jna.encoding", "GBK");  
      byte[] b = FileUtil.file2ByteArray("C:/Users/Administrator/Desktop/work/jyp/dll/钻孔检验批质量验收记录表.LIL");
      System.out.println(b);
      String nn = "llllllllllll";
  
      //System.out.println(testdll.Instance.PBF_RepToPDF_File("C:/Users/Administrator/Desktop/work/jyp/dll/1啊.LIL","C:/Users/Administrator/Desktop/work/jyp/dll/1_File.PDF" ));
      //JYP_TK_ReportDLL.Instance.PBF_RepToPDF_File("C:/Users/Administrator/Desktop/work/jyp/dll/1啊.LIL","C:/Users/Administrator/Desktop/work/jyp/dll/1_File.PDF" );
      JYP_TK_ReportDLL.Instance.PBF_RepToPDF_Stream("C:/Users/Administrator/Desktop/work/jyp/dll/1.PDF",nn);
      //JYP_TK_ReportDLL.Instance.PBF_RepToJPG_File("C:/Users/Administrator/Desktop/work/jyp/dll/1啊.LIL","C:/Users/Administrator/Desktop/work/jyp/dll/1_File.JPG" );
  }
  
  public interface JYP_TK_ReportDLL extends Library {
      JYP_TK_ReportDLL Instance = (JYP_TK_ReportDLL) Native.loadLibrary("JYP_TK_ReportDLL",
              JYP_TK_ReportDLL.class);
  
      boolean PBF_RepToPDF_Stream(String SaveFile, String arr);
      boolean PBF_RepToPDF_File(String SourceFile, String  SaveFile);
      boolean PBF_RepToJPG_File(String SourceFile, String  SaveFile);
  }
  </code></pre>