Discussion:
How to specify access to a java.nio.ByteBuffer?
Evgeni Sergeev
2007-09-18 02:10:41 UTC
Permalink
Hello,

How can I tell SWIG to accept a pointer to a java.nio.ByteBuffer, which is being passed to it by Java? Also, the size of the buffer is needed.

The aim is to have a contiguous memory space, which can be read and written by both native code and Java code, for passing a large amount of data quickly.

Evgeni

_________________________________________________________________
Win Dad the Footy Final with Cadbury Favourites!
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fbs%2Eserving%2Dsys%2Ecom%2FBurstingPipe%2FadServer%2Ebs%3Fcn%3Dtf%26c%3D20%26mc%3Dclick%26pli%3D243221%26pi%3D0%26ord%3D%25%25RANDOM%25%25&_t=765445318&_r=hotmail_email_tagline_Aug07_Cadburys&_m=EXT
Evgeni Sergeev
2007-09-18 02:11:05 UTC
Permalink
Hello,

How can I tell SWIG to accept a pointer to a java.nio.ByteBuffer, which is being passed to it by Java? Also, the size of the buffer is needed.

The aim is to have a contiguous memory space, which can be read and written by both native code and Java code, for passing a large amount of data quickly.

Evgeni

_________________________________________________________________
Telstra’s Next GTM Network - now on Pre-Paid. Find out more. www.spreadthegoodstuff.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fclk%2Eatdmt%2Ecom%2FOAT%2Fgo%2Fnnmsnnxg0080000046oat%2Fdirect%2F01%2F&_t=765565283&_r=Telstra_FFF_Prepaid_Hotmail_Email_Taglines_JuySep07_Aug&_m=EXT
William S Fulton
2007-09-25 08:48:53 UTC
Permalink
Hello,How can I tell SWIG to accept a pointer to a java.nio.ByteBuffer,
which is being passed to it by Java? Also, the size of the buffer is needed.
The aim is to have a contiguous memory space, which can be read and written
by both native code and Java code, for passing a large amount of data quickly.
Take a look at the usual set of typemaps for Java eg jni, jtype, jstype. A Google
code search such as this:
http://www.google.com/codesearch?q=jstype+ByteBuffer&hl=en&btnG=Search+Code
should take you to the GDAL typemaps which marshal void * as
java.nio.ByteBuffer.

William



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Loading...