| 503 | |
| 504 | |
| 505 | void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, size_t a_NumElements) |
| 506 | { |
| 507 | TagCommon(a_Name, TAG_IntArray); |
| 508 | Int32 len = htonl(a_NumElements); |
| 509 | size_t cap = m_Result.capacity(); |
| 510 | size_t size = m_Result.length(); |
| 511 | if ((cap - size) < (4 + a_NumElements * 4)) |
| 512 | { |
| 513 | m_Result.reserve(size + 4 + (a_NumElements * 4)); |
| 514 | } |
| 515 | m_Result.append((const char *)&len, 4); |
| 516 | for (size_t i = 0; i < a_NumElements; i++) |
| 517 | { |
| 518 | int Element = htonl(a_Value[i]); |
| 519 | m_Result.append((const char *)&Element, 4); |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | |
| 524 |
no outgoing calls
no test coverage detected