The last thing that is written seems to be an IntArray - as I predicted
Wasn't cFastNBTWriter::AddIntArray() the function that was failing? It might still be failing, but now in a different sense
Ah, of course!
The non-android code works by appending zero bytes first, then overwriting them with real values; Android cannot overwrite, so it's appending the values one by one - therefore it must not have the zero-appending code
Wasn't cFastNBTWriter::AddIntArray() the function that was failing? It might still be failing, but now in a different sense
Ah, of course!
Code:
#if defined(ANDROID_NDK)
// THIS NEEDS TO GO AWAY: m_Result.append(a_NumElements * 4, (char)0);
for (size_t i = 0; i < a_NumElements; i++)
{
int Element = htonl(a_Value[i]);
m_Result.append((const char *)&Element, 4);
}
#else
int * Elements = (int *)(m_Result.data() + m_Result.size());
m_Result.append(a_NumElements * 4, (char)0);
for (size_t i = 0; i < a_NumElements; i++)
{
Elements[i] = htonl(a_Value[i]);
}
#endif
The non-android code works by appending zero bytes first, then overwriting them with real values; Android cannot overwrite, so it's appending the values one by one - therefore it must not have the zero-appending code