Closed GoogleCodeExporter closed 9 years ago
I assume you mean that EnsureBufferSize only allocates 1 byte for string length
tho it can be larger? It would be possible to calculate the exact number of
bytes required for the actual length data, but since it's an edge case (most
strings can be assumed to be smaller than 127 characters) it's faster just to
ensure the minimum length and if it turns out to be larger,
WriteVariableUInt32() will itself call EnsureBufferSize and allocate enough
space.
Original comment by lidg...@gmail.com
on 5 Aug 2010 at 2:03
EnsureBufferSize(m_bitLength + 8 + bytes.Length * 8);
Original comment by imho.sapiens@gmail.com
on 7 Aug 2010 at 12:41
Ah, bits instead of bytes, thanks, missed that! Fixed in rev 89
Original comment by lidg...@gmail.com
on 7 Aug 2010 at 7:46
Original issue reported on code.google.com by
imho.sapiens@gmail.com
on 2 Aug 2010 at 2:40