badboy1245
Newbie
I want to copy a buffer from java over to c++.
here is what i have in the java side.
public native String stringFromJNI(String filename);
here is what i use to send the buffer over to c++
ByteBuffer buf = ByteBuffer.allocateDirect(1000);
stringFromJNI(javastring);
here is how i receive the data and put into a victor, but its not working what am i doing wrong?
char *buffer=(char *)env->GetDirectBufferAddress(buf);
int len= env->GetDirectBufferCapacity( buf);
string data;
for(int i=0;i<len;i++)
{
data=buffer;
firs.push_back( data );
}
here is what i have in the java side.
public native String stringFromJNI(String filename);
here is what i use to send the buffer over to c++
ByteBuffer buf = ByteBuffer.allocateDirect(1000);
stringFromJNI(javastring);
here is how i receive the data and put into a victor, but its not working what am i doing wrong?
char *buffer=(char *)env->GetDirectBufferAddress(buf);
int len= env->GetDirectBufferCapacity( buf);
string data;
for(int i=0;i<len;i++)
{
data=buffer;
firs.push_back( data );
}
Last edited: