Use ByteBuffer instead of a string when encoding collections