Encodes the length of the String as a prefix.
the ByteArray containing the encoded length
the size of the String
the ByteOrder to use.