SWIG - creating a typemap for function with four arguments that passes a bytearray
===

This is a follow-up of the question http://stackoverflow.com/questions/11618267/how-to-use-a-bytebuffer-return-from-c-to-java - I will acknowledge Flexo for his relentless support so far - I guess I just am not getting hang of typemaps yet... :-(  

I have a C function with four arguments as follows, where  the third and fourth arguments are passed by reference

    extern "C" int foo(const char* passByValText, const int passbyValLen, 
                 unsigned char* retText, int *retCode) 


The Calling Java Wrapper function needs to look something like this

    int foo(String passByValText, int passbyValLen, byte[] retBuf, SWIGTYPE_p_int retCode);

Alternatively it could be 

    int foo(String passByValText, int passbyValLen, ByteBuffer retBuf, SWIGTYPE_p_int retCode);

I can share an apology for a typemap that I wrote - but basically that might confuse matters even more ... so I am keeping this a clean slate ..

Thanks a ton


