Closed GoogleCodeExporter closed 8 years ago
Thanks for the feedback!
I've fixed the issue with only 16 bits of length for encrypted messages; now 32
bits.
I'm keeping the 1 byte assumption in Write(string) tho. This has the following
reasons:
1. Most string writes are below 127 characters; so any more exact calculation
is most often wasted cpu
2. In most cases the message will be large enough anyway, since it should be
recycled (and therefore preallocated) and also EnsureBufferSize() overallocates
4 bytes when enlarging
3. A missed prediction in EnsureBufferSize() is no big deal - it will just
reallocate (and overallocate, reducing the chance the next write will get the
same problem)
--michael
EnsureBufferSize() actually overallocated
Original comment by lidg...@gmail.com
on 28 Jun 2011 at 6:53
Uh... the last "EnsureBufferSize() actually overallocated" part is just a typo
:-)
Original comment by lidg...@gmail.com
on 28 Jun 2011 at 6:55
Original issue reported on code.google.com by
brettccl...@gmail.com
on 28 Jun 2011 at 4:09