Description
With ByteArrayOutputStream as the underlying data structure for a buffer, the user is forced to convert it into a byte [] object in order to do any operations other than sequence append on the buffer. The convertion will create a new copy of bytes. That will cause huge performance problem.
It seems BytesWritable is a better replacement.