Encodes a String into a ByteArray using the given Encoding and ByteOrder.
the String to encode.
the ByteOrder to use.