tags:

views:

50

answers:

0

Problem:

My code native code (c/c++) is called via JNI.

Once it's started it needs to get byte[] buffer from Java object several times per second for further heavy processing. Native code should request buffer when processing of previous buffer is completed.

The orginal idea was to pass buffer via AF_INET socket to avoid JNI stuff, but that solution did not work efficiently enough.

Possible solutions:

There are following ways to improve passing buffer:

  1. JNI stuff
  2. AF_LOCAL
  3. ???

What is the most efficient way to get java byte [] buffer from native code?