On Dec 30, 2009, at 12:36 AM, Kay Kay wrote:
In o.a.h.io.Text - the clear method currently just resets length to
0, while not doing anything about the bytes internally.
Curious to know the thoughts behind the decision (to let the
internal bytes to be reused for future appends vs. memory leaks due
to not clearing them ) ?
The byte array that backs up the Text object is always reused. It
might make sense to have a setCapacity method on Text that is similar
to BytesWritable's. With such a method, it would be possible to shrink
the size of the backing array.
-- Owen