| 4 | using namespace tns; |
| 5 | |
| 6 | DirectBuffer::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 | |
| 23 | DirectBuffer::operator jobject() const { |
| 24 | return m_buff; |
nothing calls this directly
no test coverage detected