Allow Java byte arrays to be directly encoded for byte sequence types.

Be more lenient on the type check for byte sequence types.