I see why you did this but I just think toByteArray() implementation of ByteArrayOutputStream returning a copy is just silly.

And for the first time you must have liked protected :P