I changed Protocol.encodeBytes() to use Base64 encoding to fix the issue of bytes in the range of 0xD8 - 0xDF being sent as 0x00 (issue #91).
The Base64.java file is from MiGBase64.
Switching Protocol.encodeBytes to use Base64. refs #91
Thanks for your patch! This is really helpful! I will review it and merge it during the holidays.
It's still wasteful compared to sending a length + raw bytes, but any working fix is welcome for now.