Do not synchronize on ByteBuffer, use BB.duplicate() instead.
Thanks to Stanimir Simeonoff for reviewing code and suggesting it.