MCPcopy Create free account
hub / github.com/NativeScript/android / DirectBuffer

Method DirectBuffer

test-app/runtime/src/main/cpp/DirectBuffer.cpp:6–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace tns;
5
6DirectBuffer::DirectBuffer(uint32_t length) {
7 m_length = length;
8
9 m_data = new int[m_length];
10
11 m_end = m_data + m_length;
12
13 Reset();
14
15 int capacity = m_length * sizeof(int);
16
17 JEnv env;
18 JniLocalRef buff(env.NewDirectByteBuffer(m_data, capacity));
19
20 m_buff = env.NewGlobalRef(buff);
21}
22
23DirectBuffer::operator jobject() const {
24 return m_buff;

Callers

nothing calls this directly

Calls 3

ResetFunction · 0.85
NewDirectByteBufferMethod · 0.80
NewGlobalRefMethod · 0.80

Tested by

no test coverage detected