Back to index

lightning-sunbird  0.9+nobinonly
GetByteArrayElements_2.cpp File Reference
#include "JNIEnvTests.h"
#include "ArrayOperations.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetByteArrayElements_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetByteArrayElements_2  )

Definition at line 40 of file GetByteArrayElements_2.cpp.


  jbyteArray arr = env->NewByteArray(5);
  jsize start = 0;
  jsize leng = 3;
  jbyte buf[3];
  buf[0] = MAX_JBYTE;
  buf[1] = MIN_JBYTE;
  buf[2] = 0;
  env->SetByteArrayRegion(arr, start, leng, buf);

  jboolean isCopy = JNI_TRUE;
  jbyte *val = env->GetByteArrayElements(arr, NULL);
  jbyte val0 = val[0];
  jbyte val1 = val[1];
  jbyte val2 = val[2];

     return TestResult::PASS("GetByteArrayElements(arr, NULL) returns correct value");
     return TestResult::FAIL("GetByteArrayElements(arr, NULL) returns incorrect value");


Here is the call graph for this function: