mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
don't need to pass buffer size because java arrays have a .length member
This commit is contained in:
parent
d5fc2b39aa
commit
53ebd5a9a5
2 changed files with 2 additions and 3 deletions
|
@ -194,7 +194,7 @@ namespace {
|
||||||
{
|
{
|
||||||
callbackMethod = env->GetMethodID(dataStoreGetClass,
|
callbackMethod = env->GetMethodID(dataStoreGetClass,
|
||||||
"onDataStoreGet",
|
"onDataStoreGet",
|
||||||
"(Ljava/lang/String;[BJJ[J)J");
|
"(Ljava/lang/String;[BJ[J)J");
|
||||||
if(callbackMethod == NULL)
|
if(callbackMethod == NULL)
|
||||||
{
|
{
|
||||||
return -2;
|
return -2;
|
||||||
|
@ -206,7 +206,7 @@ namespace {
|
||||||
jlongArray objectSizeObj = env->NewLongArray(1);
|
jlongArray objectSizeObj = env->NewLongArray(1);
|
||||||
|
|
||||||
long retval = env->CallLongMethod(
|
long retval = env->CallLongMethod(
|
||||||
dataStoreGetClass, callbackMethod, nameStr, bufferObj, bufferSize, bufferIndex, objectSizeObj);
|
dataStoreGetClass, callbackMethod, nameStr, bufferObj, bufferIndex, objectSizeObj);
|
||||||
|
|
||||||
env->GetByteArrayRegion(bufferObj, 0, bufferSize, (jbyte*)buffer);
|
env->GetByteArrayRegion(bufferObj, 0, bufferSize, (jbyte*)buffer);
|
||||||
env->GetLongArrayRegion(objectSizeObj, 0, 1, (jlong*)&out_objectSize);
|
env->GetLongArrayRegion(objectSizeObj, 0, 1, (jlong*)&out_objectSize);
|
||||||
|
|
|
@ -32,7 +32,6 @@ public interface DataStoreGetListener {
|
||||||
public long onDataStoreGet(
|
public long onDataStoreGet(
|
||||||
String name,
|
String name,
|
||||||
byte[] out_buffer,
|
byte[] out_buffer,
|
||||||
long bufferSize,
|
|
||||||
long bufferIndex,
|
long bufferIndex,
|
||||||
long[] out_objectSize);
|
long[] out_objectSize);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue