Set<PrimitiveType>ArrayRegion Routines - SetShortArrayRegion
void
Set<PrimitiveType>ArrayRegion(JNIEnv *env,
ArrayType array, jsize start, jsize len,
NativeType *buf); (SetShortArrayRegion)
A family of functions that copies back a region of a primitive array from a buffer.
The following table describes the specific primitive array element accessors. You should make the following replacements: (SetShortArrayRegion)
- Replace Set<PrimitiveType>ArrayRegion with one of the actual primitive element accessor routine names from the table.
- Replace ArrayType with the corresponding array type.
- Replace NativeType with the corresponding native type for that routine.Table 4-13a Set<PrimitiveType>ArrayRegion Family of Array Accessor Routines
LINKAGE of SetShortArrayRegion
Indices in the JNIEnv interface function table.
Table 4-13b Set<PrimitiveType>ArrayRegion Family of Array Accessor Routines
PARAMETERS of SetShortArrayRegion
env
: the JNI interface pointer.array
: a Java array.start
: the starting index.len
: the number of elements to be copied.buf
: the source buffer.THROWS:
ArrayIndexOutOfBoundsException
: if one of the indexes in the region is not valid.
Example of SetShortArrayRegion
case 'S': { jshort* bufferArray = reinterpret_cast<jshort*>(AgentBase::GetMemoryManager() .Allocate(sizeof(jshort)*values JDWP_FILE_LINE)); AgentAutoFree scavenger(bufferArray JDWP_FILE_LINE); for (int i = 0; i < values; i++) { value = m_cmdParser->command.ReadUntaggedValue(jni, JDWP_TAG_SHORT); JDWP_TRACE_DATA("SetValues: set: index=" << i << ", value=(short)" << value.s); bufferArray[i] = value.s; } jni->SetShortArrayRegion(static_cast<jshortArray>(arrayObject), firstIndex, values, bufferArray); break; }