static public byte [ ] convertCharToByteUTF ( char [ ] from ) { Charset c = CDM . utf8Charset ; ByteBuffer output = c . encode ( CharBuffer . wrap ( from ) ) ; return output . array ( ) ; }
convert char array to byte array assuming UTF - 8 encoding