Adjust putBytes for truncated byte buffers.
Merge pull request #1 from mtbc/bytebuffer-limit

Adjust putBytes for truncated byte buffers.